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

Side by Side Diff: chrome/browser/ui/gtk/browser_actions_toolbar_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/browser_actions_toolbar_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 BrowserActionButton* button = static_cast<BrowserActionButton*>(user_data); 374 BrowserActionButton* button = static_cast<BrowserActionButton*>(user_data);
375 button->ConnectBrowserActionPopupAccelerator(); 375 button->ConnectBrowserActionPopupAccelerator();
376 } 376 }
377 377
378 // Connect the accelerator for the browser action popup. 378 // Connect the accelerator for the browser action popup.
379 void ConnectBrowserActionPopupAccelerator() { 379 void ConnectBrowserActionPopupAccelerator() {
380 ExtensionCommandService* command_service = 380 ExtensionCommandService* command_service =
381 ExtensionCommandServiceFactory::GetForProfile( 381 ExtensionCommandServiceFactory::GetForProfile(
382 toolbar_->browser()->profile()); 382 toolbar_->browser()->profile());
383 const extensions::Command* command = 383 const extensions::Command* command =
384 command_service->GetActiveBrowserActionCommand(extension_->id()); 384 command_service->GetBrowserActionCommand(extension_->id(),
385 ExtensionCommandService::ACTIVE_ONLY);
385 if (command) { 386 if (command) {
386 // Found the browser action shortcut command, register it. 387 // Found the browser action shortcut command, register it.
387 keybinding_.reset(new ui::AcceleratorGtk( 388 keybinding_.reset(new ui::AcceleratorGtk(
388 command->accelerator().key_code(), 389 command->accelerator().key_code(),
389 command->accelerator().IsShiftDown(), 390 command->accelerator().IsShiftDown(),
390 command->accelerator().IsCtrlDown(), 391 command->accelerator().IsCtrlDown(),
391 command->accelerator().IsAltDown())); 392 command->accelerator().IsAltDown()));
392 393
393 gfx::NativeWindow window = 394 gfx::NativeWindow window =
394 toolbar_->browser()->window()->GetNativeHandle(); 395 toolbar_->browser()->window()->GetNativeHandle();
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 1080
1080 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), 1081 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root),
1081 event->time); 1082 event->time);
1082 return TRUE; 1083 return TRUE;
1083 } 1084 }
1084 1085
1085 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { 1086 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) {
1086 if (!resize_animation_.is_animating()) 1087 if (!resize_animation_.is_animating())
1087 UpdateChevronVisibility(); 1088 UpdateChevronVisibility();
1088 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698