summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/toolbar_star_toggle_gtk.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:09:39 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:09:39 +0000
commit42e8de911a526f8c86a7f5e5fc7dce82a647f6d0 (patch)
treecdc0bc11f5308d862b0023f6df6af58d731cc80a /chrome/browser/gtk/toolbar_star_toggle_gtk.h
parent9d6ad02b8c83feeefa57d6131aa4b00cabb9e914 (diff)
downloadchromium_src-42e8de911a526f8c86a7f5e5fc7dce82a647f6d0.zip
chromium_src-42e8de911a526f8c86a7f5e5fc7dce82a647f6d0.tar.gz
chromium_src-42e8de911a526f8c86a7f5e5fc7dce82a647f6d0.tar.bz2
GTK Themes: Make the location bar area look native.
Replace the star and go buttons with a native looking thing, where we manually draw the theme's button image for the full omnibox area and then position the star/go buttons on top of that. Also adds stand in versions of star_noborder and starred_noborder until Glen can make real icons. http://crbug.com/16227 http://crbug.com/13967 http://crbug.com/16915 Review URL: http://codereview.chromium.org/149681 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/toolbar_star_toggle_gtk.h')
-rw-r--r--chrome/browser/gtk/toolbar_star_toggle_gtk.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/gtk/toolbar_star_toggle_gtk.h b/chrome/browser/gtk/toolbar_star_toggle_gtk.h
index afa61a3..2284415 100644
--- a/chrome/browser/gtk/toolbar_star_toggle_gtk.h
+++ b/chrome/browser/gtk/toolbar_star_toggle_gtk.h
@@ -9,17 +9,25 @@
#include "base/basictypes.h"
#include "chrome/browser/gtk/custom_button.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
#include "chrome/common/owned_widget_gtk.h"
class BrowserToolbarGtk;
+class GtkThemeProvider;
class GURL;
// Displays the bookmark star button, which toggles between two images.
-class ToolbarStarToggleGtk {
+class ToolbarStarToggleGtk : public NotificationObserver {
public:
- ToolbarStarToggleGtk(BrowserToolbarGtk* host);
+ explicit ToolbarStarToggleGtk(BrowserToolbarGtk* host);
~ToolbarStarToggleGtk();
+ // Provide NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
// If the bubble isn't showing, shows it above the star button.
void ShowStarBubble(const GURL& url, bool newly_bookmarked);
@@ -28,10 +36,17 @@ class ToolbarStarToggleGtk {
GtkWidget* widget() const { return widget_.get(); }
private:
+ // Updates the properties of |widget_| when we would need to change its
+ // state.
+ void UpdateGTKButton();
+
// Callback for expose, used to draw the custom graphics.
static gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e,
ToolbarStarToggleGtk* obj);
+ // Used to listen for theme change notifications.
+ NotificationRegistrar registrar_;
+
// The browser toolbar hosting this widget, for getting the current profile.
BrowserToolbarGtk* host_;
@@ -41,6 +56,8 @@ class ToolbarStarToggleGtk {
// Whether we show the yellow star.
bool is_starred_;
+ GtkThemeProvider* theme_provider_;
+
CustomDrawButtonBase unstarred_;
CustomDrawButtonBase starred_;