summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 23:30:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 23:30:26 +0000
commit5bc87e02c16ccf68c69bff890af32748dba95142 (patch)
tree4733e9677e853fbd457f3afcc346fa72cf6a4776 /views
parentaf34e6cd862c0ef241c66687e0f88ffccf2c9044 (diff)
downloadchromium_src-5bc87e02c16ccf68c69bff890af32748dba95142.zip
chromium_src-5bc87e02c16ccf68c69bff890af32748dba95142.tar.gz
chromium_src-5bc87e02c16ccf68c69bff890af32748dba95142.tar.bz2
Fixes couple of bugs that occur now that we can actually run views on
gtk again. BUG=none TEST=none TBR=ben Review URL: http://codereview.chromium.org/115961 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc12
-rw-r--r--views/widget/widget_gtk.h4
2 files changed, 14 insertions, 2 deletions
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);
};