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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 10317014: Move Command class out of the Extension class and into its own location (under chrome/common/exten… (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/location_bar/page_action_image_view.h" 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/commands/extension_command_service.h" 8 #include "chrome/browser/extensions/api/commands/extension_command_service.h"
9 #include "chrome/browser/extensions/api/commands/extension_command_service_facto ry.h" 9 #include "chrome/browser/extensions/api/commands/extension_command_service_facto ry.h"
10 #include "chrome/browser/extensions/extension_browser_event_router.h" 10 #include "chrome/browser/extensions/extension_browser_event_router.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 61 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
62 content::Source<Profile>( 62 content::Source<Profile>(
63 owner_->profile()->GetOriginalProfile())); 63 owner_->profile()->GetOriginalProfile()));
64 64
65 set_accessibility_focusable(true); 65 set_accessibility_focusable(true);
66 66
67 ExtensionCommandService* command_service = 67 ExtensionCommandService* command_service =
68 ExtensionCommandServiceFactory::GetForProfile(browser_->profile()); 68 ExtensionCommandServiceFactory::GetForProfile(browser_->profile());
69 const Extension::Command* page_action_command = 69 const extensions::Command* page_action_command =
70 command_service->GetActivePageActionCommand(extension->id()); 70 command_service->GetActivePageActionCommand(extension->id());
71 if (page_action_command) { 71 if (page_action_command) {
72 keybinding_.reset(new ui::Accelerator(page_action_command->accelerator())); 72 keybinding_.reset(new ui::Accelerator(page_action_command->accelerator()));
73 owner_->GetFocusManager()->RegisterAccelerator( 73 owner_->GetFocusManager()->RegisterAccelerator(
74 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); 74 *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
75 } 75 }
76 } 76 }
77 77
78 PageActionImageView::~PageActionImageView() { 78 PageActionImageView::~PageActionImageView() {
79 if (keybinding_.get() && owner_->GetFocusManager()) 79 if (keybinding_.get() && owner_->GetFocusManager())
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 const Extension* unloaded_extension = 274 const Extension* unloaded_extension =
275 content::Details<UnloadedExtensionInfo>(details)->extension; 275 content::Details<UnloadedExtensionInfo>(details)->extension;
276 if (page_action_ == unloaded_extension ->page_action()) 276 if (page_action_ == unloaded_extension ->page_action())
277 owner_->UpdatePageActions(); 277 owner_->UpdatePageActions();
278 } 278 }
279 279
280 void PageActionImageView::HidePopup() { 280 void PageActionImageView::HidePopup() {
281 if (popup_) 281 if (popup_)
282 popup_->GetWidget()->Close(); 282 popup_->GetWidget()->Close();
283 } 283 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698