| OLD | NEW |
| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 extensions::TabHelper::FromWebContents(tab_contents->web_contents())-> | 124 extensions::TabHelper::FromWebContents(tab_contents->web_contents())-> |
| 125 active_tab_permission_manager()->GrantIfRequested(extension); | 125 active_tab_permission_granter()->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 Loading... |
| 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 } |
| OLD | NEW |