diff options
-rw-r--r-- | app/theme_provider.h | 2 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 12 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/app/theme_provider.h b/app/theme_provider.h index 29ce2ce..c01842c 100644 --- a/app/theme_provider.h +++ b/app/theme_provider.h @@ -34,7 +34,7 @@ class ThemeProvider { // Get the color specified by |id|. virtual SkColor GetColor(int id) = 0; -#if defined(OS_LINUX) +#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme // provider and should not be freed. diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index a1d30f6..c021a84 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -6,6 +6,7 @@ #include "base/compiler_specific.h" #include "views/fill_layout.h" +#include "views/widget/default_theme_provider.h" #include "views/widget/root_view.h" #include "views/widget/tooltip_manager_gtk.h" #include "views/window/window_gtk.h" @@ -76,6 +77,8 @@ void WidgetGtk::Init(GtkWidget* parent, // Force creation of the RootView if it hasn't been created yet. GetRootView(); + default_theme_provider_.reset(new DefaultThemeProvider()); + // Make container here. CreateGtkWidget(); @@ -116,8 +119,9 @@ void WidgetGtk::Init(GtkWidget* parent, G_CALLBACK(CallButtonPress), NULL); g_signal_connect(G_OBJECT(child_widget_parent_), "button_release_event", G_CALLBACK(CallButtonRelease), NULL); - g_signal_connect(G_OBJECT(child_widget_parent_), "grab_broke_event", - G_CALLBACK(CallGrabBrokeEvent), NULL); + // TODO(sky): this crashes, fix it! + // g_signal_connect(G_OBJECT(child_widget_parent_), "grab_broke_event", + // G_CALLBACK(CallGrabBrokeEvent), NULL); g_signal_connect(G_OBJECT(child_widget_parent_), "grab_notify", G_CALLBACK(CallGrabNotify), NULL); g_signal_connect(G_OBJECT(child_widget_parent_), "focus_out_event", @@ -320,6 +324,10 @@ const Window* WidgetGtk::GetWindow() const { return GetWindowImpl(widget_); } +ThemeProvider* WidgetGtk::GetThemeProvider() const { + return default_theme_provider_.get(); +} + //////////////////////////////////////////////////////////////////////////////// // WidgetGtk, MessageLoopForUI::Observer implementation: diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index 3d57e4f..3fd866b 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -16,6 +16,7 @@ class Rect; namespace views { +class DefaultThemeProvider; class TooltipManagerGtk; class View; class WindowGtk; @@ -78,6 +79,7 @@ class WidgetGtk : public Widget, public MessageLoopForUI::Observer { virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator); virtual Window* GetWindow(); virtual const Window* GetWindow() const; + virtual ThemeProvider* GetThemeProvider() const; // MessageLoopForUI::Observer. virtual void WillProcessEvent(GdkEvent* event) {} @@ -198,6 +200,8 @@ class WidgetGtk : public Widget, public MessageLoopForUI::Observer { // See description above setter. bool delete_on_destroy_; + scoped_ptr<DefaultThemeProvider> default_theme_provider_; + DISALLOW_COPY_AND_ASSIGN(WidgetGtk); }; |