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

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs.cc ('k') | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_toolbar_model.h" 5 #include "chrome/browser/extensions/extension_toolbar_model.h"
6 6
7 #include "chrome/browser/extensions/browser_event_router.h" 7 #include "chrome/browser/extensions/browser_event_router.h"
8 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 int tab_id = ExtensionTabUtil::GetTabId(tab_contents->web_contents()); 114 int tab_id = ExtensionTabUtil::GetTabId(tab_contents->web_contents());
115 if (tab_id < 0) 115 if (tab_id < 0)
116 return ACTION_NONE; 116 return ACTION_NONE;
117 117
118 ExtensionAction* browser_action = extension->browser_action(); 118 ExtensionAction* browser_action = extension->browser_action();
119 119
120 // For browser actions, visibility == enabledness. 120 // For browser actions, visibility == enabledness.
121 if (!browser_action->GetIsVisible(tab_id)) 121 if (!browser_action->GetIsVisible(tab_id))
122 return ACTION_NONE; 122 return ACTION_NONE;
123 123
124 tab_contents->extension_tab_helper()->active_tab_permission_manager()-> 124 extensions::TabHelper::FromWebContents(tab_contents->web_contents())->
125 GrantIfRequested(extension); 125 active_tab_permission_manager()->GrantIfRequested(extension);
126 126
127 if (browser_action->HasPopup(tab_id)) { 127 if (browser_action->HasPopup(tab_id)) {
128 if (popup_url_out) 128 if (popup_url_out)
129 *popup_url_out = browser_action->GetPopupUrl(tab_id); 129 *popup_url_out = browser_action->GetPopupUrl(tab_id);
130 return ACTION_SHOW_POPUP; 130 return ACTION_SHOW_POPUP;
131 } 131 }
132 132
133 service_->browser_event_router()->BrowserActionExecuted( 133 service_->browser_event_router()->BrowserActionExecuted(
134 *browser_action, browser); 134 *browser_action, browser);
135 return ACTION_NONE; 135 return ACTION_NONE;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 for (ExtensionList::iterator iter = toolbar_items_.begin(); 398 for (ExtensionList::iterator iter = toolbar_items_.begin();
399 iter != toolbar_items_.end(); 399 iter != toolbar_items_.end();
400 ++iter, ++i) { 400 ++iter, ++i) {
401 if (original_index == i) 401 if (original_index == i)
402 break; 402 break;
403 if (service_->IsIncognitoEnabled((*iter)->id())) 403 if (service_->IsIncognitoEnabled((*iter)->id()))
404 ++incognito_index; 404 ++incognito_index;
405 } 405 }
406 return incognito_index; 406 return incognito_index;
407 } 407 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs.cc ('k') | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698