diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 16:49:21 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 16:49:21 +0000 |
commit | 89769009cc5eaae554fd9b6c0b9a5de9983b13b3 (patch) | |
tree | 978416630d7a611abe82289da237cad326cfb8ec /chrome/browser/gtk/browser_titlebar.h | |
parent | 0ba5c5e634c8e0282169fd94e119d9e4070b1e6d (diff) | |
download | chromium_src-89769009cc5eaae554fd9b6c0b9a5de9983b13b3.zip chromium_src-89769009cc5eaae554fd9b6c0b9a5de9983b13b3.tar.gz chromium_src-89769009cc5eaae554fd9b6c0b9a5de9983b13b3.tar.bz2 |
GTK Themes: Reapply r23734, fixing destruction order issues.
http://crbug.com/18856
Review URL: http://codereview.chromium.org/174100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.h')
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h index 29b3cb2..a3dbb0c 100644 --- a/chrome/browser/gtk/browser_titlebar.h +++ b/chrome/browser/gtk/browser_titlebar.h @@ -14,13 +14,17 @@ #include "base/scoped_ptr.h" #include "chrome/browser/gtk/menu_gtk.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" class BrowserWindowGtk; class CustomDrawButton; +class GtkThemeProvider; class TabContents; class TabStripGtk; -class BrowserTitlebar : public MenuGtk::Delegate { +class BrowserTitlebar : public MenuGtk::Delegate, + public NotificationObserver { public: BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window); virtual ~BrowserTitlebar() { } @@ -29,6 +33,8 @@ class BrowserTitlebar : public MenuGtk::Delegate { return container_; } + void set_window(GtkWindow* window) { window_ = window; } + // Update the appearance of the title bar based on whether we're showing a // custom frame or not. If |use_custom_frame| is true, we show an extra // tall titlebar and the min/max/close buttons. @@ -83,6 +89,10 @@ class BrowserTitlebar : public MenuGtk::Delegate { // Update the titlebar spacing based on the custom frame and maximized state. void UpdateTitlebarAlignment(); + // Updates the color of the title bar. Called whenever we have a state + // change in the window. + void UpdateTextColor(); + // Callback for changes to window state. This includes // maximizing/restoring/minimizing the window. static gboolean OnWindowStateChanged(GtkWindow* window, @@ -103,6 +113,11 @@ class BrowserTitlebar : public MenuGtk::Delegate { virtual bool IsItemChecked(int command_id) const; virtual void ExecuteCommand(int command_id); + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + // Pointers to the browser window that owns us and it's GtkWindow. BrowserWindowGtk* browser_window_; GtkWindow* window_; @@ -127,6 +142,10 @@ class BrowserTitlebar : public MenuGtk::Delegate { // Whether we are using a custom frame. bool using_custom_frame_; + // Whether we have focus (gtk_window_is_active() sometimes returns the wrong + // value, so manually track the focus-in and focus-out events.) + bool window_has_focus_; + // We change the size of these three buttons when the window is maximized, so // we use these structs to keep track of their original size. GtkRequisition close_button_req_; @@ -144,6 +163,11 @@ class BrowserTitlebar : public MenuGtk::Delegate { // The throbber used when the window is in app mode or popup window mode. Throbber throbber_; + + // Theme provider for building buttons. + GtkThemeProvider* theme_provider_; + + NotificationRegistrar registrar_; }; #endif // CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_ |