Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1799)

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.h

Issue 1234223005: Initial gtk3 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Silence gtk memory leak Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_status_icon.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_status_icon.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698