| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } else { | 116 } else { |
| 117 // Set the icon to be the default extensions icon. | 117 // Set the icon to be the default extensions icon. |
| 118 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 118 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 119 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); | 119 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); |
| 120 UpdateState(); | 120 UpdateState(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 ExtensionCommandService* command_service = | 123 ExtensionCommandService* command_service = |
| 124 ExtensionCommandServiceFactory::GetForProfile( | 124 ExtensionCommandServiceFactory::GetForProfile( |
| 125 panel_->browser()->profile()); | 125 panel_->browser()->profile()); |
| 126 const Extension::Command* browser_action_command = | 126 const extensions::Command* browser_action_command = |
| 127 command_service->GetActiveBrowserActionCommand(extension_->id()); | 127 command_service->GetActiveBrowserActionCommand(extension_->id()); |
| 128 if (browser_action_command) { | 128 if (browser_action_command) { |
| 129 keybinding_.reset(new ui::Accelerator( | 129 keybinding_.reset(new ui::Accelerator( |
| 130 browser_action_command->accelerator())); | 130 browser_action_command->accelerator())); |
| 131 panel_->GetFocusManager()->RegisterAccelerator( | 131 panel_->GetFocusManager()->RegisterAccelerator( |
| 132 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); | 132 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 MenuButton::ViewHierarchyChanged(is_add, parent, child); | 136 MenuButton::ViewHierarchyChanged(is_add, parent, child); |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 } | 1124 } |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1127 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
| 1128 const Extension* extension) { | 1128 const Extension* extension) { |
| 1129 // Only display incognito-enabled extensions while in incognito mode. | 1129 // Only display incognito-enabled extensions while in incognito mode. |
| 1130 return | 1130 return |
| 1131 (!profile_->IsOffTheRecord() || | 1131 (!profile_->IsOffTheRecord() || |
| 1132 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1132 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
| 1133 } | 1133 } |
| OLD | NEW |