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

Side by Side Diff: chrome/browser/ui/gtk/menu_bar_helper.h

Issue 8536036: Devirtualize CHROMEGTK_CALLBACK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h ('k') | chrome/browser/ui/gtk/sad_tab_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This class replicates some menubar behaviors that are tricky to get right. 5 // This class replicates some menubar behaviors that are tricky to get right.
6 // It is used to create a more native feel for the bookmark bar. 6 // It is used to create a more native feel for the bookmark bar.
7 7
8 #ifndef CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_ 8 #ifndef CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_
9 #define CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_ 9 #define CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_
10 #pragma once 10 #pragma once
(...skipping 16 matching lines...) Expand all
27 virtual ~Delegate() {} 27 virtual ~Delegate() {}
28 28
29 // Called when a the menu for a button ought to be triggered. 29 // Called when a the menu for a button ought to be triggered.
30 virtual void PopupForButton(GtkWidget* button) = 0; 30 virtual void PopupForButton(GtkWidget* button) = 0;
31 virtual void PopupForButtonNextTo(GtkWidget* button, 31 virtual void PopupForButtonNextTo(GtkWidget* button,
32 GtkMenuDirectionType dir) = 0; 32 GtkMenuDirectionType dir) = 0;
33 }; 33 };
34 34
35 // |delegate| cannot be null. 35 // |delegate| cannot be null.
36 explicit MenuBarHelper(Delegate* delegate); 36 explicit MenuBarHelper(Delegate* delegate);
37 virtual ~MenuBarHelper(); 37 ~MenuBarHelper();
38 38
39 // Must be called whenever a button's menu starts showing. It triggers the 39 // Must be called whenever a button's menu starts showing. It triggers the
40 // MenuBarHelper to start listening for certain events. 40 // MenuBarHelper to start listening for certain events.
41 void MenuStartedShowing(GtkWidget* button, GtkWidget* menu); 41 void MenuStartedShowing(GtkWidget* button, GtkWidget* menu);
42 42
43 // Add |button| to the set of buttons we care about. 43 // Add |button| to the set of buttons we care about.
44 void Add(GtkWidget* button); 44 void Add(GtkWidget* button);
45 45
46 // Remove |button| from the set of buttons we care about. 46 // Remove |button| from the set of buttons we care about.
47 void Remove(GtkWidget* button); 47 void Remove(GtkWidget* button);
(...skipping 23 matching lines...) Expand all
71 std::vector<GtkWidget*> submenus_; 71 std::vector<GtkWidget*> submenus_;
72 72
73 // Signal handlers that are attached only between the "show" and "hide" events 73 // Signal handlers that are attached only between the "show" and "hide" events
74 // for the menu. 74 // for the menu.
75 scoped_ptr<ui::GtkSignalRegistrar> signal_handlers_; 75 scoped_ptr<ui::GtkSignalRegistrar> signal_handlers_;
76 76
77 Delegate* delegate_; 77 Delegate* delegate_;
78 }; 78 };
79 79
80 #endif // CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_ 80 #endif // CHROME_BROWSER_UI_GTK_MENU_BAR_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h ('k') | chrome/browser/ui/gtk/sad_tab_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698