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

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 10383240: This adds a webui overlay on the extensions page for showing what Extension keybindings are active.… (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 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 UpdateChromeToMobileIcon(); 1665 UpdateChromeToMobileIcon();
1666 } 1666 }
1667 1667
1668 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() { 1668 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() {
1669 const ExtensionSet* extensions = owner_->browser()->profile()-> 1669 const ExtensionSet* extensions = owner_->browser()->profile()->
1670 GetExtensionService()->extensions(); 1670 GetExtensionService()->extensions();
1671 const Extension* extension = 1671 const Extension* extension =
1672 extensions->GetByID(page_action_->extension_id()); 1672 extensions->GetByID(page_action_->extension_id());
1673 window_ = owner_->browser()->window()->GetNativeHandle(); 1673 window_ = owner_->browser()->window()->GetNativeHandle();
1674 1674
1675 ExtensionCommandService* command_service = 1675 extensions::ExtensionCommandService* command_service =
1676 ExtensionCommandServiceFactory::GetForProfile( 1676 extensions::ExtensionCommandServiceFactory::GetForProfile(
1677 owner_->browser()->profile()); 1677 owner_->browser()->profile());
1678 const extensions::Command* command = 1678 const extensions::Command* command =
1679 command_service->GetActivePageActionCommand(extension->id()); 1679 command_service->GetPageActionCommand(
1680 extension->id(),
1681 extensions::ExtensionCommandService::ACTIVE_ONLY);
1680 if (command) { 1682 if (command) {
1681 // Found the browser action shortcut command, register it. 1683 // Found the browser action shortcut command, register it.
1682 keybinding_.reset(new ui::AcceleratorGtk( 1684 keybinding_.reset(new ui::AcceleratorGtk(
1683 command->accelerator().key_code(), 1685 command->accelerator().key_code(),
1684 command->accelerator().IsShiftDown(), 1686 command->accelerator().IsShiftDown(),
1685 command->accelerator().IsCtrlDown(), 1687 command->accelerator().IsCtrlDown(),
1686 command->accelerator().IsAltDown())); 1688 command->accelerator().IsAltDown()));
1687 1689
1688 accel_group_ = gtk_accel_group_new(); 1690 accel_group_ = gtk_accel_group_new();
1689 gtk_window_add_accel_group(window_, accel_group_); 1691 gtk_window_add_accel_group(window_, accel_group_);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 GdkModifierType modifier, 1796 GdkModifierType modifier,
1795 void* user_data) { 1797 void* user_data) {
1796 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); 1798 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data);
1797 if (!gtk_widget_get_visible(view->widget())) 1799 if (!gtk_widget_get_visible(view->widget()))
1798 return FALSE; 1800 return FALSE;
1799 1801
1800 GdkEventButton event = {}; 1802 GdkEventButton event = {};
1801 event.button = 1; 1803 event.button = 1;
1802 return view->OnButtonPressed(view->widget(), &event); 1804 return view->OnButtonPressed(view->widget(), &event);
1803 } 1805 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698