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

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.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/gtk/location_bar_view_gtk.h" 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() { 1695 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() {
1696 const ExtensionSet* extensions = owner_->browser()->profile()-> 1696 const ExtensionSet* extensions = owner_->browser()->profile()->
1697 GetExtensionService()->extensions(); 1697 GetExtensionService()->extensions();
1698 const Extension* extension = 1698 const Extension* extension =
1699 extensions->GetByID(page_action_->extension_id()); 1699 extensions->GetByID(page_action_->extension_id());
1700 window_ = owner_->browser()->window()->GetNativeHandle(); 1700 window_ = owner_->browser()->window()->GetNativeHandle();
1701 1701
1702 ExtensionCommandService* command_service = 1702 ExtensionCommandService* command_service =
1703 ExtensionCommandServiceFactory::GetForProfile( 1703 ExtensionCommandServiceFactory::GetForProfile(
1704 owner_->browser()->profile()); 1704 owner_->browser()->profile());
1705 const Extension::Command* command = 1705 const extensions::Command* command =
1706 command_service->GetActivePageActionCommand(extension->id()); 1706 command_service->GetActivePageActionCommand(extension->id());
1707 if (command) { 1707 if (command) {
1708 // Found the browser action shortcut command, register it. 1708 // Found the browser action shortcut command, register it.
1709 keybinding_.reset(new ui::AcceleratorGtk( 1709 keybinding_.reset(new ui::AcceleratorGtk(
1710 command->accelerator().key_code(), 1710 command->accelerator().key_code(),
1711 command->accelerator().IsShiftDown(), 1711 command->accelerator().IsShiftDown(),
1712 command->accelerator().IsCtrlDown(), 1712 command->accelerator().IsCtrlDown(),
1713 command->accelerator().IsAltDown())); 1713 command->accelerator().IsAltDown()));
1714 1714
1715 accel_group_ = gtk_accel_group_new(); 1715 accel_group_ = gtk_accel_group_new();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 GdkModifierType modifier, 1805 GdkModifierType modifier,
1806 void* user_data) { 1806 void* user_data) {
1807 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); 1807 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data);
1808 if (!gtk_widget_get_visible(view->widget())) 1808 if (!gtk_widget_get_visible(view->widget()))
1809 return FALSE; 1809 return FALSE;
1810 1810
1811 GdkEventButton event = {}; 1811 GdkEventButton event = {};
1812 event.button = 1; 1812 event.button = 1;
1813 return view->OnButtonPressed(view->widget(), &event); 1813 return view->OnButtonPressed(view->widget(), &event);
1814 } 1814 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698