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

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

Issue 10387224: Rename ExtensionCommand* to Command* within the extension namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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"
11 #include "chrome/browser/extensions/api/commands/extension_command_service.h" 11 #include "chrome/browser/extensions/api/commands/command_service.h"
12 #include "chrome/browser/extensions/api/commands/extension_command_service_facto ry.h" 12 #include "chrome/browser/extensions/api/commands/command_service_factory.h"
13 #include "chrome/browser/extensions/extension_browser_event_router.h" 13 #include "chrome/browser/extensions/extension_browser_event_router.h"
14 #include "chrome/browser/extensions/extension_context_menu_model.h" 14 #include "chrome/browser/extensions/extension_context_menu_model.h"
15 #include "chrome/browser/extensions/extension_host.h" 15 #include "chrome/browser/extensions/extension_host.h"
16 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/extension_tabs_module.h" 17 #include "chrome/browser/extensions/extension_tabs_module.h"
18 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/sessions/restore_tab_helper.h" 20 #include "chrome/browser/sessions/restore_tab_helper.h"
21 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/browser_window.h" 22 #include "chrome/browser/ui/browser_window.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 gfx::Size(Extension::kBrowserActionIconMaxSize, 126 gfx::Size(Extension::kBrowserActionIconMaxSize,
127 Extension::kBrowserActionIconMaxSize), 127 Extension::kBrowserActionIconMaxSize),
128 ImageLoadingTracker::DONT_CACHE); 128 ImageLoadingTracker::DONT_CACHE);
129 } else { 129 } else {
130 // Set the icon to be the default extensions icon. 130 // Set the icon to be the default extensions icon.
131 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( 131 default_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
132 IDR_EXTENSIONS_FAVICON).ToSkBitmap(); 132 IDR_EXTENSIONS_FAVICON).ToSkBitmap();
133 UpdateState(); 133 UpdateState();
134 } 134 }
135 135
136 extensions::ExtensionCommandService* command_service = 136 extensions::CommandService* command_service =
137 extensions::ExtensionCommandServiceFactory::GetForProfile( 137 extensions::CommandServiceFactory::GetForProfile(
138 panel_->browser()->profile()); 138 panel_->browser()->profile());
139 const extensions::Command* browser_action_command = 139 const extensions::Command* browser_action_command =
140 command_service->GetBrowserActionCommand( 140 command_service->GetBrowserActionCommand(
141 extension_->id(), 141 extension_->id(),
142 extensions::ExtensionCommandService::ACTIVE_ONLY); 142 extensions::CommandService::ACTIVE_ONLY);
143 if (browser_action_command) { 143 if (browser_action_command) {
144 keybinding_.reset(new ui::Accelerator( 144 keybinding_.reset(new ui::Accelerator(
145 browser_action_command->accelerator())); 145 browser_action_command->accelerator()));
146 panel_->GetFocusManager()->RegisterAccelerator( 146 panel_->GetFocusManager()->RegisterAccelerator(
147 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); 147 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
148 } 148 }
149 } 149 }
150 150
151 MenuButton::ViewHierarchyChanged(is_add, parent, child); 151 MenuButton::ViewHierarchyChanged(is_add, parent, child);
152 } 152 }
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 } 1135 }
1136 } 1136 }
1137 1137
1138 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1138 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1139 const Extension* extension) { 1139 const Extension* extension) {
1140 // Only display incognito-enabled extensions while in incognito mode. 1140 // Only display incognito-enabled extensions while in incognito mode.
1141 return 1141 return
1142 (!profile_->IsOffTheRecord() || 1142 (!profile_->IsOffTheRecord() ||
1143 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); 1143 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id()));
1144 } 1144 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/views/extensions/extension_installed_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698