| OLD | NEW |
| 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 // 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_UI_GTK_BROWSER_TITLEBAR_H_ | 10 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TITLEBAR_H_ |
| 11 #define CHROME_BROWSER_UI_GTK_BROWSER_TITLEBAR_H_ | 11 #define CHROME_BROWSER_UI_GTK_BROWSER_TITLEBAR_H_ |
| 12 #pragma once | 12 #pragma once |
| 13 | 13 |
| 14 #include <gtk/gtk.h> | 14 #include <gtk/gtk.h> |
| 15 | 15 |
| 16 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "chrome/browser/prefs/pref_member.h" | 18 #include "chrome/browser/prefs/pref_member.h" |
| 18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 20 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
| 21 #include "ui/base/models/simple_menu_model.h" | 22 #include "ui/base/models/simple_menu_model.h" |
| 22 #include "ui/base/x/active_window_watcher_x_observer.h" | 23 #include "ui/base/x/active_window_watcher_x_observer.h" |
| 23 | 24 |
| 24 class AvatarMenuButtonGtk; | 25 class AvatarMenuButtonGtk; |
| 25 class BrowserWindowGtk; | 26 class BrowserWindowGtk; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 159 |
| 159 // Callback for favicon/settings buttons. | 160 // Callback for favicon/settings buttons. |
| 160 CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, | 161 CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, |
| 161 OnFaviconMenuButtonPressed, GdkEventButton*); | 162 OnFaviconMenuButtonPressed, GdkEventButton*); |
| 162 CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, | 163 CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, |
| 163 OnPanelSettingsMenuButtonPressed, GdkEventButton*); | 164 OnPanelSettingsMenuButtonPressed, GdkEventButton*); |
| 164 | 165 |
| 165 // -- Context Menu ----------------------------------------------------------- | 166 // -- Context Menu ----------------------------------------------------------- |
| 166 | 167 |
| 167 // SimpleMenuModel::Delegate implementation: | 168 // SimpleMenuModel::Delegate implementation: |
| 168 virtual bool IsCommandIdEnabled(int command_id) const; | 169 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| 169 virtual bool IsCommandIdChecked(int command_id) const; | 170 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| 170 virtual void ExecuteCommand(int command_id); | 171 virtual void ExecuteCommand(int command_id) OVERRIDE; |
| 171 virtual bool GetAcceleratorForCommandId(int command_id, | 172 virtual bool GetAcceleratorForCommandId( |
| 172 ui::Accelerator* accelerator); | 173 int command_id, |
| 174 ui::Accelerator* accelerator) OVERRIDE; |
| 173 | 175 |
| 174 // Overridden from content::NotificationObserver: | 176 // Overridden from content::NotificationObserver: |
| 175 virtual void Observe(int type, | 177 virtual void Observe(int type, |
| 176 const content::NotificationSource& source, | 178 const content::NotificationSource& source, |
| 177 const content::NotificationDetails& details) OVERRIDE; | 179 const content::NotificationDetails& details) OVERRIDE; |
| 178 | 180 |
| 179 // Overriden from ActiveWindowWatcherXObserver. | 181 // Overriden from ActiveWindowWatcherXObserver. |
| 180 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; | 182 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; |
| 181 | 183 |
| 182 bool IsTypePanel(); | 184 bool IsTypePanel(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // The avatar button. | 278 // The avatar button. |
| 277 scoped_ptr<AvatarMenuButtonGtk> avatar_button_; | 279 scoped_ptr<AvatarMenuButtonGtk> avatar_button_; |
| 278 | 280 |
| 279 // Theme provider for building buttons. | 281 // Theme provider for building buttons. |
| 280 GtkThemeService* theme_service_; | 282 GtkThemeService* theme_service_; |
| 281 | 283 |
| 282 content::NotificationRegistrar registrar_; | 284 content::NotificationRegistrar registrar_; |
| 283 }; | 285 }; |
| 284 | 286 |
| 285 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TITLEBAR_H_ | 287 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TITLEBAR_H_ |
| OLD | NEW |