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

Side by Side Diff: chrome/browser/gtk/browser_titlebar.h

Issue 244029: GTK: Implement popup favicon menu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_titlebar.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // A helper class that contains the gtk widgets that make up the titlebar. The 5 // A helper class that contains the gtk widgets that make up the titlebar. The
6 // titlebar consists of the tabstrip and if the custom chrome frame is turned 6 // titlebar consists of the tabstrip and if the custom chrome frame is turned
7 // on, it includes the taller titlebar and minimize, restore, maximize, and 7 // on, it includes the taller titlebar and minimize, restore, maximize, and
8 // close buttons. 8 // close buttons.
9 9
10 #ifndef CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_ 10 #ifndef CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 int image_hot, GtkWidget* box, 88 int image_hot, GtkWidget* box,
89 int tooltip); 89 int tooltip);
90 90
91 // Update the titlebar spacing based on the custom frame and maximized state. 91 // Update the titlebar spacing based on the custom frame and maximized state.
92 void UpdateTitlebarAlignment(); 92 void UpdateTitlebarAlignment();
93 93
94 // Updates the color of the title bar. Called whenever we have a state 94 // Updates the color of the title bar. Called whenever we have a state
95 // change in the window. 95 // change in the window.
96 void UpdateTextColor(); 96 void UpdateTextColor();
97 97
98 // Show the menu that the user gets from left-clicking the favicon.
99 void ShowFaviconMenu(GdkEventButton* event);
100
98 // Callback for changes to window state. This includes 101 // Callback for changes to window state. This includes
99 // maximizing/restoring/minimizing the window. 102 // maximizing/restoring/minimizing the window.
100 static gboolean OnWindowStateChanged(GtkWindow* window, 103 static gboolean OnWindowStateChanged(GtkWindow* window,
101 GdkEventWindowState* event, 104 GdkEventWindowState* event,
102 BrowserTitlebar* titlebar); 105 BrowserTitlebar* titlebar);
103 106
104 // Callback for mousewheel events. 107 // Callback for mousewheel events.
105 static gboolean OnScroll(GtkWidget* widget, GdkEventScroll* event, 108 static gboolean OnScroll(GtkWidget* widget, GdkEventScroll* event,
106 BrowserTitlebar* titlebar); 109 BrowserTitlebar* titlebar);
107 110
108 // Callback for min/max/close buttons. 111 // Callback for min/max/close buttons.
109 static void OnButtonClicked(GtkWidget* button, BrowserTitlebar* window); 112 static void OnButtonClicked(GtkWidget* button, BrowserTitlebar* window);
110 113
114 // Callback for favicon.
115 static gboolean OnButtonPressed(GtkWidget* widget, GdkEventButton* event,
116 BrowserTitlebar* titlebar);
117
111 // -- Context Menu ----------------------------------------------------------- 118 // -- Context Menu -----------------------------------------------------------
112 119
113 // MenuGtk::Delegate implementation: 120 // MenuGtk::Delegate implementation:
114 virtual bool IsCommandEnabled(int command_id) const; 121 virtual bool IsCommandEnabled(int command_id) const;
115 virtual bool IsItemChecked(int command_id) const; 122 virtual bool IsItemChecked(int command_id) const;
116 virtual void ExecuteCommand(int command_id); 123 virtual void ExecuteCommand(int command_id);
117 124
118 // Overridden from NotificationObserver: 125 // Overridden from NotificationObserver:
119 virtual void Observe(NotificationType type, 126 virtual void Observe(NotificationType type,
120 const NotificationSource& source, 127 const NotificationSource& source,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 166
160 // Maximize and restore widgets in the titlebar. 167 // Maximize and restore widgets in the titlebar.
161 scoped_ptr<CustomDrawButton> minimize_button_; 168 scoped_ptr<CustomDrawButton> minimize_button_;
162 scoped_ptr<CustomDrawButton> maximize_button_; 169 scoped_ptr<CustomDrawButton> maximize_button_;
163 scoped_ptr<CustomDrawButton> restore_button_; 170 scoped_ptr<CustomDrawButton> restore_button_;
164 scoped_ptr<CustomDrawButton> close_button_; 171 scoped_ptr<CustomDrawButton> close_button_;
165 172
166 // The context menu. 173 // The context menu.
167 scoped_ptr<MenuGtk> context_menu_; 174 scoped_ptr<MenuGtk> context_menu_;
168 175
176 // The favicon menu.
177 scoped_ptr<MenuGtk> favicon_menu_;
178
169 // The throbber used when the window is in app mode or popup window mode. 179 // The throbber used when the window is in app mode or popup window mode.
170 Throbber throbber_; 180 Throbber throbber_;
171 181
172 // Theme provider for building buttons. 182 // Theme provider for building buttons.
173 GtkThemeProvider* theme_provider_; 183 GtkThemeProvider* theme_provider_;
174 184
175 NotificationRegistrar registrar_; 185 NotificationRegistrar registrar_;
176 }; 186 };
177 187
178 #endif // CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_ 188 #endif // CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_titlebar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698