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/ui/views/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Set the icon to be the default extensions icon. | 128 // Set the icon to be the default extensions icon. |
129 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 129 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
130 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); | 130 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); |
131 UpdateState(); | 131 UpdateState(); |
132 } | 132 } |
133 | 133 |
134 ExtensionCommandService* command_service = | 134 ExtensionCommandService* command_service = |
135 ExtensionCommandServiceFactory::GetForProfile( | 135 ExtensionCommandServiceFactory::GetForProfile( |
136 panel_->browser()->profile()); | 136 panel_->browser()->profile()); |
137 const extensions::Command* browser_action_command = | 137 const extensions::Command* browser_action_command = |
138 command_service->GetActiveBrowserActionCommand(extension_->id()); | 138 command_service->GetBrowserActionCommand( |
| 139 extension_->id(), ExtensionCommandService::ACTIVE_ONLY); |
139 if (browser_action_command) { | 140 if (browser_action_command) { |
140 keybinding_.reset(new ui::Accelerator( | 141 keybinding_.reset(new ui::Accelerator( |
141 browser_action_command->accelerator())); | 142 browser_action_command->accelerator())); |
142 panel_->GetFocusManager()->RegisterAccelerator( | 143 panel_->GetFocusManager()->RegisterAccelerator( |
143 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); | 144 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); |
144 } | 145 } |
145 } | 146 } |
146 | 147 |
147 MenuButton::ViewHierarchyChanged(is_add, parent, child); | 148 MenuButton::ViewHierarchyChanged(is_add, parent, child); |
148 } | 149 } |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 } | 1133 } |
1133 } | 1134 } |
1134 | 1135 |
1135 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1136 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
1136 const Extension* extension) { | 1137 const Extension* extension) { |
1137 // Only display incognito-enabled extensions while in incognito mode. | 1138 // Only display incognito-enabled extensions while in incognito mode. |
1138 return | 1139 return |
1139 (!profile_->IsOffTheRecord() || | 1140 (!profile_->IsOffTheRecord() || |
1140 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1141 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
1141 } | 1142 } |
OLD | NEW |