diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 18:53:28 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 18:53:28 +0000 |
commit | 72f6797d566159af1fb25c680334e98c6dbbdd2f (patch) | |
tree | e1f7d86fedc30387fc784618bda926d59d23859b /chrome/browser/extensions/browser_event_router.cc | |
parent | b80ec461c95510aaa218c4ebeb5b3c4752bb2610 (diff) | |
download | chromium_src-72f6797d566159af1fb25c680334e98c6dbbdd2f.zip chromium_src-72f6797d566159af1fb25c680334e98c6dbbdd2f.tar.gz chromium_src-72f6797d566159af1fb25c680334e98c6dbbdd2f.tar.bz2 |
Remove some TabContentses from extensions.
This is a removal from ExtensionTabUtil and then following dependencies.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11308012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/browser_event_router.cc')
-rw-r--r-- | chrome/browser/extensions/browser_event_router.cc | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/chrome/browser/extensions/browser_event_router.cc b/chrome/browser/extensions/browser_event_router.cc index 996a54d..a47d6fb 100644 --- a/chrome/browser/extensions/browser_event_router.cc +++ b/chrome/browser/extensions/browser_event_router.cc @@ -89,8 +89,7 @@ void BrowserEventRouter::Init() { Browser* browser = *iter; if (browser->tab_strip_model()) { for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { - WebContents* contents = - chrome::GetTabContentsAt(browser, i)->web_contents(); + WebContents* contents = chrome::GetWebContentsAt(browser, i); int tab_id = ExtensionTabUtil::GetTabId(contents); tab_entries_[tab_id] = TabEntry(); } @@ -121,8 +120,7 @@ void BrowserEventRouter::RegisterForBrowserNotifications(Browser* browser) { browser->tab_strip_model()->AddObserver(this); for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { - RegisterForTabNotifications( - chrome::GetTabContentsAt(browser, i)->web_contents()); + RegisterForTabNotifications(chrome::GetWebContentsAt(browser, i)); } } @@ -295,10 +293,10 @@ void BrowserEventRouter::TabSelectionChanged( for (size_t i = 0; i < new_selection.size(); ++i) { int index = new_selection[i]; - TabContents* contents = tab_strip_model->GetTabContentsAt(index); + WebContents* contents = tab_strip_model->GetWebContentsAt(index); if (!contents) break; - int tab_id = ExtensionTabUtil::GetTabId(contents->web_contents()); + int tab_id = ExtensionTabUtil::GetTabId(contents); all->Append(Value::CreateIntegerValue(tab_id)); } @@ -528,11 +526,11 @@ void BrowserEventRouter::BrowserActionExecuted( const ExtensionAction& browser_action, Browser* browser) { Profile* profile = browser->profile(); - TabContents* tab_contents = NULL; + WebContents* web_contents = NULL; int tab_id = 0; - if (!ExtensionTabUtil::GetDefaultTab(browser, &tab_contents, &tab_id)) + if (!ExtensionTabUtil::GetDefaultTab(browser, &web_contents, &tab_id)) return; - ExtensionActionExecuted(profile, browser_action, tab_contents); + ExtensionActionExecuted(profile, browser_action, web_contents); } void BrowserEventRouter::PageActionExecuted(Profile* profile, @@ -542,24 +540,24 @@ void BrowserEventRouter::PageActionExecuted(Profile* profile, int button) { DispatchOldPageActionEvent(profile, page_action.extension_id(), page_action.id(), tab_id, url, button); - TabContents* tab_contents = NULL; + WebContents* web_contents = NULL; if (!ExtensionTabUtil::GetTabById(tab_id, profile, profile->IsOffTheRecord(), - NULL, NULL, &tab_contents, NULL)) { + NULL, NULL, &web_contents, NULL)) { return; } - ExtensionActionExecuted(profile, page_action, tab_contents); + ExtensionActionExecuted(profile, page_action, web_contents); } void BrowserEventRouter::ScriptBadgeExecuted( Profile* profile, const ExtensionAction& script_badge, int tab_id) { - TabContents* tab_contents = NULL; + WebContents* web_contents = NULL; if (!ExtensionTabUtil::GetTabById(tab_id, profile, profile->IsOffTheRecord(), - NULL, NULL, &tab_contents, NULL)) { + NULL, NULL, &web_contents, NULL)) { return; } - ExtensionActionExecuted(profile, script_badge, tab_contents); + ExtensionActionExecuted(profile, script_badge, web_contents); } void BrowserEventRouter::CommandExecuted(Profile* profile, @@ -578,7 +576,7 @@ void BrowserEventRouter::CommandExecuted(Profile* profile, void BrowserEventRouter::ExtensionActionExecuted( Profile* profile, const ExtensionAction& extension_action, - TabContents* tab_contents) { + WebContents* web_contents) { const char* event_name = NULL; switch (extension_action.action_type()) { case Extension::ActionInfo::TYPE_BROWSER: @@ -595,7 +593,7 @@ void BrowserEventRouter::ExtensionActionExecuted( if (event_name) { scoped_ptr<ListValue> args(new ListValue()); DictionaryValue* tab_value = ExtensionTabUtil::CreateTabValue( - tab_contents->web_contents(), + web_contents, ExtensionTabUtil::INCLUDE_PRIVACY_SENSITIVE_FIELDS); args->Append(tab_value); |