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

Side by Side Diff: chrome/browser/ui/gtk/browser_actions_toolbar_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/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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 static void OnRealize(GtkWidget* widget, void* user_data) { 373 static void OnRealize(GtkWidget* widget, void* user_data) {
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 Extension::Command* command = 383 const extensions::Command* command =
384 command_service->GetActiveBrowserActionCommand(extension_->id()); 384 command_service->GetActiveBrowserActionCommand(extension_->id());
385 if (command) { 385 if (command) {
386 // Found the browser action shortcut command, register it. 386 // Found the browser action shortcut command, register it.
387 keybinding_.reset(new ui::AcceleratorGtk( 387 keybinding_.reset(new ui::AcceleratorGtk(
388 command->accelerator().key_code(), 388 command->accelerator().key_code(),
389 command->accelerator().IsShiftDown(), 389 command->accelerator().IsShiftDown(),
390 command->accelerator().IsCtrlDown(), 390 command->accelerator().IsCtrlDown(),
391 command->accelerator().IsAltDown())); 391 command->accelerator().IsAltDown()));
392 392
393 gfx::NativeWindow window = 393 gfx::NativeWindow window =
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 1079
1080 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), 1080 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root),
1081 event->time); 1081 event->time);
1082 return TRUE; 1082 return TRUE;
1083 } 1083 }
1084 1084
1085 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { 1085 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) {
1086 if (!resize_animation_.is_animating()) 1086 if (!resize_animation_.is_animating())
1087 UpdateChevronVisibility(); 1087 UpdateChevronVisibility();
1088 } 1088 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698