Convert a bunch of WebContentsObservers to use web_contents() instead of tab_contents(), as well as all the dependent code.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/8982008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115777 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 4ab20a64..d5236a9 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -44,9 +44,9 @@
}
// TODO(sky): this function should really take a TabContentsWrapper.
-int ExtensionTabUtil::GetWindowIdOfTab(const TabContents* tab_contents) {
+int ExtensionTabUtil::GetWindowIdOfTab(const WebContents* web_contents) {
const TabContentsWrapper* tab =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
+ TabContentsWrapper::GetCurrentWrapperForContents(web_contents);
return tab ? tab->restore_tab_helper()->window_id().id() : -1;
}
@@ -71,8 +71,7 @@
return keys::kShowStateValueNormal;
}
-DictionaryValue* ExtensionTabUtil::CreateTabValue(
- const TabContents* contents) {
+DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents) {
// Find the tab strip and index of this guy.
TabStripModel* tab_strip = NULL;
int tab_index;
@@ -94,7 +93,7 @@
return tab_list;
}
-DictionaryValue* ExtensionTabUtil::CreateTabValue(const TabContents* contents,
+DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents,
TabStripModel* tab_strip,
int tab_index) {
DictionaryValue* result = new DictionaryValue();
@@ -129,7 +128,7 @@
}
DictionaryValue* ExtensionTabUtil::CreateTabValueActive(
- const TabContents* contents,
+ const WebContents* contents,
bool active) {
DictionaryValue* result = ExtensionTabUtil::CreateTabValue(contents);
result->SetBoolean(keys::kSelectedKey, active);
@@ -167,17 +166,17 @@
return result;
}
-bool ExtensionTabUtil::GetTabStripModel(const TabContents* tab_contents,
+bool ExtensionTabUtil::GetTabStripModel(const WebContents* web_contents,
TabStripModel** tab_strip_model,
int* tab_index) {
- DCHECK(tab_contents);
+ DCHECK(web_contents);
DCHECK(tab_strip_model);
DCHECK(tab_index);
for (BrowserList::const_iterator it = BrowserList::begin();
it != BrowserList::end(); ++it) {
TabStripModel* tab_strip = (*it)->tabstrip_model();
- int index = tab_strip->GetWrapperIndex(tab_contents);
+ int index = tab_strip->GetWrapperIndex(web_contents);
if (index != -1) {
*tab_strip_model = tab_strip;
*tab_index = index;