Index: chrome/browser/ui/libgtk2ui/gtk2_ui.h |
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.h b/chrome/browser/ui/libgtk2ui/gtk2_ui.h |
index 5497591a7c5a42c6af2a58cf9889c0abe417168f..c7b7524c72221997fcfe9a59d0c7a8edcd0fba69 100644 |
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.h |
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.h |
@@ -21,11 +21,9 @@ |
#include "ui/views/linux_ui/linux_ui.h" |
#include "ui/views/window/frame_buttons.h" |
-typedef struct _GdkColor GdkColor; |
typedef struct _GtkBorder GtkBorder; |
typedef struct _GtkStyle GtkStyle; |
typedef struct _GtkWidget GtkWidget; |
-typedef struct _PangoFontDescription PangoFontDescription; |
class SkBitmap; |
@@ -55,13 +53,15 @@ class Gtk2UI : public views::LinuxUI { |
const std::vector<views::FrameButton>& trailing_buttons); |
void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); |
- // Draws the GTK button border for state |gtk_state| onto a bitmap. |
- SkBitmap DrawGtkButtonBorder(int gtk_state, |
- bool focused, |
- bool call_to_action, |
+ // Draws the GTK button border with the given properties onto a bitmap. |
+ SkBitmap DrawGtkButtonBorder(const char* class_name, |
+ ui::NativeTheme::State state, |
int width, |
int height) const; |
+ // Called when gtk style changes |
+ void ResetStyle(); |
+ |
// ui::LinuxInputMethodContextFactory: |
scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( |
ui::LinuxInputMethodContextDelegate* delegate, |
@@ -132,9 +132,7 @@ class Gtk2UI : public views::LinuxUI { |
// This method returns the colors webkit will use for the scrollbars. When no |
// colors are specified by the GTK+ theme, this function averages of the |
// thumb part and of the track colors. |
- void GetScrollbarColors(GdkColor* thumb_active_color, |
- GdkColor* thumb_inactive_color, |
- GdkColor* track_color); |
+ void SetScrollbarColors(); |
// Extracts colors and tints from the GTK theme, both for the |
// ThemeService interface and the colors we send to webkit. |
@@ -142,20 +140,10 @@ class Gtk2UI : public views::LinuxUI { |
// Reads in explicit theme frame colors from the ChromeGtkFrame style class |
// or generates them per our fallback algorithm. |
- GdkColor BuildFrameColors(GtkStyle* frame_style); |
- |
- // Sets the underlying theme colors/tints from a GTK color. |
- void SetThemeColorFromGtk(int id, const GdkColor* color); |
- void SetThemeTintFromGtk(int id, const GdkColor* color); |
+ SkColor BuildFrameColors(); |
- // Creates and returns a frame color, either using |gtk_base| verbatim if |
- // non-NULL, or tinting |base| with |tint|. Also sets |color_id| and |
- // |tint_id| to the returned color. |
- GdkColor BuildAndSetFrameColor(const GdkColor* base, |
- const GdkColor* gtk_base, |
- const color_utils::HSL& tint, |
- int color_id, |
- int tint_id); |
+ // Sets the underlying theme tints. |
+ void SetThemeTint(int id, SkColor color); |
// Lazily generates each bitmap used in the gtk theme. |
SkBitmap GenerateGtkThemeBitmap(int id) const; |
@@ -179,8 +167,9 @@ class Gtk2UI : public views::LinuxUI { |
SkBitmap GenerateGTKIcon(int base_id) const; |
// Renders a GTK button border the size of the image |sizing_idr| in |
- // |gtk_state|. |
- SkBitmap GenerateToolbarBezel(int gtk_state, int sizing_idr) const; |
+ // |state|. |
+ SkBitmap GenerateToolbarBezel(ui::NativeTheme::State state, |
+ int sizing_idr) const; |
// Returns the tint for buttons that contrasts with the normal window |
// background color. |
@@ -199,19 +188,8 @@ class Gtk2UI : public views::LinuxUI { |
// Frees all calculated images and color data. |
void ClearAllThemeData(); |
- // Updates |default_font_*| based on |desc|. |
- void UpdateDefaultFont(const PangoFontDescription* desc); |
- |
- // Handles signal from GTK that our theme has been changed. |
- CHROMEGTK_CALLBACK_1(Gtk2UI, void, OnStyleSet, GtkStyle*); |
- |
- GtkWidget* fake_window_; |
- GtkWidget* fake_frame_; |
- OwnedWidgetGtk fake_label_; |
- OwnedWidgetGtk fake_entry_; |
- |
- // Tracks all the signals we have connected to on various widgets. |
- scoped_ptr<Gtk2SignalRegistrar> signals_; |
+ // Updates |default_font_*|. |
+ void UpdateDefaultFont(); |
// Tints and colors calculated by LoadGtkValues() that are given to the |
// caller while |use_gtk_| is true. |