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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 10201016: Conflict detection for Extension Keybinding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
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/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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 Extension::kBrowserActionIconMaxSize), 112 Extension::kBrowserActionIconMaxSize),
113 ImageLoadingTracker::DONT_CACHE); 113 ImageLoadingTracker::DONT_CACHE);
114 } else { 114 } else {
115 // Set the icon to be the default extensions icon. 115 // Set the icon to be the default extensions icon.
116 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( 116 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
117 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); 117 IDR_EXTENSIONS_FAVICON).ToSkBitmap();
118 UpdateState(); 118 UpdateState();
119 } 119 }
120 120
121 const Extension::ExtensionKeybinding* browser_action_command = 121 const Extension::ExtensionKeybinding* browser_action_command =
122 extension_->browser_action_command(); 122 ExtensionKeybindingRegistry::GetActiveBrowserActionCommand(
123 panel_->browser()->profile(), extension_->id());
123 if (browser_action_command) { 124 if (browser_action_command) {
124 keybinding_.reset(new ui::Accelerator( 125 keybinding_.reset(new ui::Accelerator(
125 browser_action_command->accelerator())); 126 browser_action_command->accelerator()));
126 panel_->GetFocusManager()->RegisterAccelerator( 127 panel_->GetFocusManager()->RegisterAccelerator(
127 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); 128 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
128 } 129 }
129 } 130 }
130 131
131 MenuButton::ViewHierarchyChanged(is_add, parent, child); 132 MenuButton::ViewHierarchyChanged(is_add, parent, child);
132 } 133 }
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 } 1121 }
1121 } 1122 }
1122 1123
1123 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1124 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1124 const Extension* extension) { 1125 const Extension* extension) {
1125 // Only display incognito-enabled extensions while in incognito mode. 1126 // Only display incognito-enabled extensions while in incognito mode.
1126 return 1127 return
1127 (!profile_->IsOffTheRecord() || 1128 (!profile_->IsOffTheRecord() ||
1128 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); 1129 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id()));
1129 } 1130 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698