172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen// Copyright (c) 2011 The Chromium Authors. All rights reserved. 2c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Use of this source code is governed by a BSD-style license that can be 3c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// found in the LICENSE file. 4c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#ifndef CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ 672a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#define CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ 73345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick#pragma once 8c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 9c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#include <gtk/gtk.h> 10c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 11ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#include "base/memory/scoped_ptr.h" 1272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#include "chrome/browser/ui/gtk/owned_widget_gtk.h" 13dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen#include "content/common/notification_observer.h" 14dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen#include "content/common/notification_registrar.h" 15c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#include "third_party/skia/include/core/SkColor.h" 163f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen#include "ui/base/animation/animation_delegate.h" 173f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen#include "ui/base/animation/slide_animation.h" 1872a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#include "ui/base/gtk/gtk_signal.h" 1972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#include "ui/gfx/rect.h" 20c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 21c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochclass CairoCachedSurface; 22ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenclass GtkThemeService; 23c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochclass SkBitmap; 24c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 25c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// These classes implement two kinds of custom-drawn buttons. They're 26c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// used on the toolbar and the bookmarks bar. 27c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 28c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// CustomDrawButtonBase provides the base for building a custom drawn button. 29c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// It handles managing the pixbufs containing all the static images used to draw 30c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// the button. It also manages painting these pixbufs. 31c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochclass CustomDrawButtonBase : public NotificationObserver { 32c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch public: 33c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // If the images come from ResourceBundle rather than the theme provider, 34c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // pass in NULL for |theme_provider|. 35ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen CustomDrawButtonBase(GtkThemeService* theme_provider, 36c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int normal_id, 373345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int pressed_id, 383345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int hover_id, 393345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int disabled_id); 40c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 41c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch ~CustomDrawButtonBase(); 42c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 43c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL 44c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // mode, this will unflip the image.) 45c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void set_flipped(bool flipped) { flipped_ = flipped; } 46c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 47c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Returns the dimensions of the first surface. 48c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int Width() const; 49c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int Height() const; 50c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 51c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e, gdouble hover_state); 52c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 53c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void set_paint_override(int state) { paint_override_ = state; } 54c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int paint_override() const { return paint_override_; } 55c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 56c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Set the background details. 57c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void SetBackground(SkColor color, SkBitmap* image, SkBitmap* mask); 58c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 59c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Provide NotificationObserver implementation. 60c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch virtual void Observe(NotificationType type, 61c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch const NotificationSource& source, 62c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch const NotificationDetails& details); 63c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 64c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch private: 65c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Get the CairoCachedSurface from |surfaces_| for |state|. 66c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch CairoCachedSurface* PixbufForState(int state); 67c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 68c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // We store one surface for each possible state of the button; 69c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // INSENSITIVE is the last available state; 70c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch scoped_ptr<CairoCachedSurface> surfaces_[GTK_STATE_INSENSITIVE + 1]; 71c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 72c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // The background image. 73c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch scoped_ptr<CairoCachedSurface> background_image_; 74c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 75c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // If non-negative, the state to paint the button. 76c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int paint_override_; 77c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 78c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // We need to remember the image ids that the user passes in and the theme 79c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // provider so we can reload images if the user changes theme. 80c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int normal_id_; 813345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int pressed_id_; 823345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int hover_id_; 833345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int disabled_id_; 84ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen GtkThemeService* theme_service_; 85c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 86c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Whether the button is flipped horizontally. Not used for RTL (we get 87c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // flipped versions from the theme provider). Used for the flipped window 88c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // buttons. 89c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch bool flipped_; 90c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 91c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Used to listen for theme change notifications. 92c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch NotificationRegistrar registrar_; 93c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 94c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch DISALLOW_COPY_AND_ASSIGN(CustomDrawButtonBase); 95c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch}; 96c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 97c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// CustomDrawHoverController is a convenience class that eases the common task 98c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// of controlling the hover state of a button. The "hover state" refers to the 99c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// percent opacity of a button's PRELIGHT. The PRELIGHT is animated such that 100c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// when a user moves a mouse over a button the PRELIGHT fades in. 1013f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsenclass CustomDrawHoverController : public ui::AnimationDelegate { 102c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch public: 103c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch explicit CustomDrawHoverController(GtkWidget* widget); 104c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch CustomDrawHoverController(); 105c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 106c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch virtual ~CustomDrawHoverController(); 107c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 108c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void Init(GtkWidget* widget); 109c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 110c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch double GetCurrentValue() { 111c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch return slide_animation_.GetCurrentValue(); 112c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch } 113c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 114c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch private: 1153f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen virtual void AnimationProgressed(const ui::Animation* animation); 116c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 1173345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick CHROMEGTK_CALLBACK_1(CustomDrawHoverController, gboolean, OnEnter, 1183345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick GdkEventCrossing*); 1193345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick CHROMEGTK_CALLBACK_1(CustomDrawHoverController, gboolean, OnLeave, 1203345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick GdkEventCrossing*); 121c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 1223f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen ui::SlideAnimation slide_animation_; 123c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch GtkWidget* widget_; 124c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch}; 125c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 126c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// CustomDrawButton is a plain button where all its various states are drawn 127c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// with static images. In GTK rendering mode, it will show the standard button 128c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// with GTK |stock_id|. 129c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochclass CustomDrawButton : public NotificationObserver { 130c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch public: 131c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // The constructor takes 4 resource ids. If a resource doesn't exist for a 132c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // button, pass in 0. 133c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch CustomDrawButton(int normal_id, 1343345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int pressed_id, 1353345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int hover_id, 1363345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int disabled_id); 137c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 1383345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // Same as above, but uses themed (and possibly tinted) images. |stock_id| and 1393345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // |stock_size| are used for GTK+ theme mode. 140ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen CustomDrawButton(GtkThemeService* theme_provider, 141c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int normal_id, 1423345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int pressed_id, 1433345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int hover_id, 1443345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int disabled_id, 145c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch const char* stock_id, 146c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch GtkIconSize stock_size); 147c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 1483345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // As above, but uses an arbitrary GtkImage rather than a stock icon. This 1493345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // constructor takes ownership of |native_widget|. 150ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen CustomDrawButton(GtkThemeService* theme_provider, 1513345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int normal_id, 1523345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int pressed_id, 1533345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int hover_id, 1543345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick int disabled_id, 1553345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick GtkWidget* native_widget); 1563345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick 157c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch ~CustomDrawButton(); 158c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 159c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void Init(); 160c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 161c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL 162c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // mode, this will unflip the image.) 163c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void set_flipped(bool flipped) { button_base_.set_flipped(flipped); } 164c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 165c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch GtkWidget* widget() const { return widget_.get(); } 166c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 167c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch gfx::Rect bounds() const { 168c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch return gfx::Rect(widget_->allocation.x, 169c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch widget_->allocation.y, 170c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch widget_->allocation.width, 171c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch widget_->allocation.height); 172c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch } 173c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 174c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int width() const { return widget_->allocation.width; } 175c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch int height() const { return widget_->allocation.height; } 176c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 177c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Set the state to draw. We will paint the widget as if it were in this 178c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // state. 179c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void SetPaintOverride(GtkStateType state); 180c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 181c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Resume normal drawing of the widget's state. 182c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void UnsetPaintOverride(); 183c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 184c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Set the background details. 185c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void SetBackground(SkColor color, SkBitmap* image, SkBitmap* mask); 186c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 187c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // NotificationObserver implementation. 188c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch virtual void Observe(NotificationType type, 189c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch const NotificationSource& source, 190c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch const NotificationDetails& details); 191c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 192c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Returns a standard close button. Pass a |theme_provider| to use Gtk icons 193c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // in Gtk rendering mode. 194ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen static CustomDrawButton* CloseButton(GtkThemeService* theme_provider); 195c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 196c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch private: 197c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Sets the button to themed or not. 198c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch void SetBrowserTheme(); 199c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 2003345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // Whether to use the GTK+ theme. For this to be true, we have to be in GTK+ 2013345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // theme mode and we must have a valid stock icon resource. 2023345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick bool UseGtkTheme(); 2033345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick 204c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Callback for custom button expose, used to draw the custom graphics. 2053345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick CHROMEGTK_CALLBACK_1(CustomDrawButton, gboolean, OnCustomExpose, 2063345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick GdkEventExpose*); 207c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 208c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // The actual button widget. 209c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch OwnedWidgetGtk widget_; 210c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 211c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch CustomDrawButtonBase button_base_; 212c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 213c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch CustomDrawHoverController hover_controller_; 214c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 2153345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick // The widget to use when we are displaying in GTK+ theme mode. 2163345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick OwnedWidgetGtk native_widget_; 2173345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick 218c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Our theme provider. 219ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen GtkThemeService* theme_service_; 220c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 221c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch // Used to listen for theme change notifications. 222c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch NotificationRegistrar registrar_; 223c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 224c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); 225c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch}; 226c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 22772a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ 228