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

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

Issue 9965049: ui/base: Clean up our AcceleratorGtk class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 commands[i].accelerator().IsShiftDown(), 1724 commands[i].accelerator().IsShiftDown(),
1725 commands[i].accelerator().IsCtrlDown(), 1725 commands[i].accelerator().IsCtrlDown(),
1726 commands[i].accelerator().IsAltDown())); 1726 commands[i].accelerator().IsAltDown()));
1727 1727
1728 accel_group_ = gtk_accel_group_new(); 1728 accel_group_ = gtk_accel_group_new();
1729 gtk_window_add_accel_group(window_, accel_group_); 1729 gtk_window_add_accel_group(window_, accel_group_);
1730 1730
1731 gtk_accel_group_connect( 1731 gtk_accel_group_connect(
1732 accel_group_, 1732 accel_group_,
1733 keybinding_->GetGdkKeyCode(), 1733 keybinding_->GetGdkKeyCode(),
1734 keybinding_->gdk_modifier_type(), 1734 keybinding_->GetGdkModifierType(),
1735 GtkAccelFlags(0), 1735 GtkAccelFlags(0),
1736 g_cclosure_new(G_CALLBACK(OnGtkAccelerator), this, NULL)); 1736 g_cclosure_new(G_CALLBACK(OnGtkAccelerator), this, NULL));
1737 1737
1738 // Since we've added an accelerator, we'll need to unregister it before 1738 // Since we've added an accelerator, we'll need to unregister it before
1739 // the window is closed, so we listen for the window being closed. 1739 // the window is closed, so we listen for the window being closed.
1740 registrar_.Add(this, 1740 registrar_.Add(this,
1741 chrome::NOTIFICATION_WINDOW_CLOSED, 1741 chrome::NOTIFICATION_WINDOW_CLOSED,
1742 content::Source<GtkWindow>(window_)); 1742 content::Source<GtkWindow>(window_));
1743 break; 1743 break;
1744 } 1744 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 GdkModifierType modifier, 1819 GdkModifierType modifier,
1820 void* user_data) { 1820 void* user_data) {
1821 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); 1821 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data);
1822 if (!gtk_widget_get_visible(view->widget())) 1822 if (!gtk_widget_get_visible(view->widget()))
1823 return FALSE; 1823 return FALSE;
1824 1824
1825 GdkEventButton event = {}; 1825 GdkEventButton event = {};
1826 event.button = 1; 1826 event.button = 1;
1827 return view->OnButtonPressed(view->widget(), &event); 1827 return view->OnButtonPressed(view->widget(), &event);
1828 } 1828 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698