diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-12 20:26:22 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-12 20:26:22 +0000 |
commit | 7381d9f388a029ea08d074ed00b52f8d24e79f0c (patch) | |
tree | 2a53e818b4e80c5d0e7232c7d4cbea221f5c1b07 /chrome/browser/extensions/api | |
parent | d7ac7c264e1bdbee971bd4996c5b920eb813e01e (diff) | |
download | chromium_src-7381d9f388a029ea08d074ed00b52f8d24e79f0c.zip chromium_src-7381d9f388a029ea08d074ed00b52f8d24e79f0c.tar.gz chromium_src-7381d9f388a029ea08d074ed00b52f8d24e79f0c.tar.bz2 |
Switch Extensions::TabHelper to use WebContents, WebContentsUserData.
BUG=107201
TEST=no visible change
TBR=ben@chromium.org
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155743
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=155901
Review URL: https://chromiumcodereview.appspot.com/10917026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api')
6 files changed, 32 insertions, 25 deletions
diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc index 1f919f1..78a1815 100644 --- a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc +++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc @@ -376,7 +376,8 @@ void ExtensionActionFunction::NotifyBrowserActionChange() { } void ExtensionActionFunction::NotifyLocationBarChange() { - contents_->extension_tab_helper()->location_bar_controller()->NotifyChange(); + extensions::TabHelper::FromWebContents(contents_->web_contents())-> + location_bar_controller()->NotifyChange(); } // static @@ -425,7 +426,7 @@ bool ExtensionActionFunction::SetVisible(bool visible) { extensions::TabHelper& ExtensionActionFunction::tab_helper() const { CHECK(contents_); - return *contents_->extension_tab_helper(); + return *extensions::TabHelper::FromWebContents(contents_->web_contents()); } bool ExtensionActionShowFunction::RunExtensionAction() { diff --git a/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc index eff7b16..55cba75 100644 --- a/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc +++ b/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc @@ -99,7 +99,8 @@ bool PageActionsFunction::SetPageActionEnabled(bool enable) { tab_id, enable ? ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE); page_action->SetTitle(tab_id, title); page_action->SetIconIndex(tab_id, icon_id); - contents->extension_tab_helper()->location_bar_controller()->NotifyChange(); + extensions::TabHelper::FromWebContents(contents->web_contents())-> + location_bar_controller()->NotifyChange(); return true; } diff --git a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc index cd7bbf1..bc655e3 100644 --- a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc @@ -45,8 +45,9 @@ IN_PROC_BROWSER_TEST_F(ScriptBadgeApiTest, Basics) { ExtensionAction* script_badge = extension->script_badge(); ASSERT_TRUE(script_badge); const extensions::LocationBarController* location_bar_controller = - chrome::GetActiveTabContents(browser())->extension_tab_helper()-> - location_bar_controller(); + extensions::TabHelper::FromWebContents( + chrome::GetActiveWebContents(browser()))-> + location_bar_controller(); const int tab_id = SessionID::IdForTab( chrome::GetActiveWebContents(browser())); diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc index 85b352b..efe9f07 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc @@ -84,8 +84,8 @@ void ExtensionOmniboxEventRouter::OnInputEntered( ExtensionSystem::Get(profile)->extension_service()->extensions()-> GetByID(extension_id); CHECK(extension); - tab_contents->extension_tab_helper()->active_tab_permission_manager()-> - GrantIfRequested(extension); + extensions::TabHelper::FromWebContents(tab_contents->web_contents())-> + active_tab_permission_manager()->GrantIfRequested(extension); scoped_ptr<ListValue> args(new ListValue()); args->Set(0, Value::CreateStringValue(input)); diff --git a/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc b/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc index 43da953..5b76613 100644 --- a/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc +++ b/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc @@ -265,13 +265,14 @@ bool ExecuteCodeInTabFunction::Execute(const std::string& code_string) { } CHECK_NE(UserScript::UNDEFINED, run_at); - contents->extension_tab_helper()->script_executor()->ExecuteScript( - extension->id(), - script_type, - code_string, - frame_scope, - run_at, - ScriptExecutor::ISOLATED_WORLD, - base::Bind(&ExecuteCodeInTabFunction::OnExecuteCodeFinished, this)); + extensions::TabHelper::FromWebContents(contents->web_contents())-> + script_executor()->ExecuteScript( + extension->id(), + script_type, + code_string, + frame_scope, + run_at, + ScriptExecutor::ISOLATED_WORLD, + base::Bind(&ExecuteCodeInTabFunction::OnExecuteCodeFinished, this)); return true; } diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc index 02ef474..3775511 100644 --- a/chrome/browser/extensions/api/tabs/tabs.cc +++ b/chrome/browser/extensions/api/tabs/tabs.cc @@ -615,8 +615,10 @@ bool CreateWindowFunction::RunImpl() { for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { TabContents* tab = chrome::AddSelectedTabWithURL( new_window, *i, content::PAGE_TRANSITION_LINK); - if (window_type == Browser::TYPE_PANEL) - tab->extension_tab_helper()->SetExtensionAppIconById(extension_id); + if (window_type == Browser::TYPE_PANEL) { + extensions::TabHelper::FromWebContents(tab->web_contents())-> + SetExtensionAppIconById(extension_id); + } } if (contents) { TabStripModel* target_tab_strip = new_window->tab_strip_model(); @@ -1346,14 +1348,15 @@ bool UpdateTabFunction::UpdateURLIfPresent(DictionaryValue* update_props, return false; } - tab_contents_->extension_tab_helper()->script_executor()->ExecuteScript( - extension_id(), - ScriptExecutor::JAVASCRIPT, - url.path(), - ScriptExecutor::TOP_FRAME, - extensions::UserScript::DOCUMENT_IDLE, - ScriptExecutor::MAIN_WORLD, - base::Bind(&UpdateTabFunction::OnExecuteCodeFinished, this)); + extensions::TabHelper::FromWebContents(tab_contents_->web_contents())-> + script_executor()->ExecuteScript( + extension_id(), + ScriptExecutor::JAVASCRIPT, + url.path(), + ScriptExecutor::TOP_FRAME, + extensions::UserScript::DOCUMENT_IDLE, + ScriptExecutor::MAIN_WORLD, + base::Bind(&UpdateTabFunction::OnExecuteCodeFinished, this)); *is_async = true; return true; |