Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5065)

Unified Diff: chrome/browser/extensions/api/tabs/tabs.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/tabs.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc
index 02ef4747f582e7e08a63e2bddb904d11ae5977fd..37755111b5a6d212a386e3e478ee3b8199a08ec5 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;

Powered by Google App Engine
This is Rietveld 408576698