Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | |
| 6 #define CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | |
| 7 | |
| 8 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" | |
| 9 #include "ui/native_theme/native_theme_base.h" | |
| 10 | |
| 11 typedef struct _GdkColor GdkColor; | |
| 12 typedef struct _GtkStyle GtkStyle; | |
| 13 typedef struct _GtkWidget GtkWidget; | |
| 14 | |
| 15 namespace libgtk2ui { | |
| 16 | |
| 17 // A version of NativeTheme that uses GTK2 supplied colours instead of the | |
| 18 // default aura colours. Analogue to NativeThemeWin, except that can't be | |
| 19 // compiled into the main chrome binary like the Windows code can. | |
| 20 class NativeThemeGtk2 : public ui::NativeThemeBase { | |
| 21 public: | |
| 22 static NativeThemeGtk2* instance(); | |
| 23 | |
| 24 // Overridden from ui::NativeThemeBase: | |
| 25 virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE; | |
| 26 virtual void PaintMenuPopupBackground( | |
| 27 SkCanvas* canvas, | |
| 28 const gfx::Size& size, | |
| 29 const MenuBackgroundExtraParams& menu_background) const OVERRIDE; | |
| 30 | |
| 31 private: | |
| 32 NativeThemeGtk2(); | |
| 33 virtual ~NativeThemeGtk2(); | |
| 34 | |
| 35 // Implementation of GetSystemColor. | |
| 36 GdkColor GetSystemGdkColor(ColorId color_id) const; | |
| 37 | |
| 38 // Returns styles associated with various widget types. | |
| 39 GtkWidget* GetRealizedWindow() const; | |
| 40 GtkStyle* GetWindowStyle() const; | |
| 41 GtkStyle* GetEntryStyle() const; | |
| 42 GtkStyle* GetLabelStyle() const; | |
| 43 GtkStyle* GetButtonStyle() const; | |
| 44 GtkStyle* GetMenuStyle() const; | |
| 45 GtkStyle* GetMenuItemStyle() const; | |
| 46 | |
| 47 mutable GtkWidget* fake_window_; | |
|
sky
2013/03/05 03:59:03
How come this one can't be an OwnedWidgetGtk too?
| |
| 48 mutable OwnedWidgetGtk fake_entry_; | |
| 49 mutable OwnedWidgetGtk fake_label_; | |
| 50 mutable OwnedWidgetGtk fake_button_; | |
| 51 | |
| 52 mutable OwnedWidgetGtk fake_menu_; | |
| 53 mutable GtkWidget* fake_menu_item_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2); | |
| 56 }; | |
| 57 | |
| 58 } // namespace libgtk2ui | |
| 59 | |
| 60 #endif // CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | |
| OLD | NEW |