summaryrefslogtreecommitdiffstats
path: root/views/controls/button
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 04:23:00 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 04:23:00 +0000
commit4c9471c16ba43fb40017e9f5fae8231799e86ccb (patch)
tree86d1f5ec140af9841b92108299208ca3e7fdfed7 /views/controls/button
parent061efec5fa1af222d72b887feb5788260cb5248f (diff)
downloadchromium_src-4c9471c16ba43fb40017e9f5fae8231799e86ccb.zip
chromium_src-4c9471c16ba43fb40017e9f5fae8231799e86ccb.tar.gz
chromium_src-4c9471c16ba43fb40017e9f5fae8231799e86ccb.tar.bz2
Fix build bustage by removing another dependency on browser/gtk by creating a new TabContentsViewGtk specifically for views. This subclasses WidgetGtk similar to how TabContentsViewWin subclasses WidgetWin.
There was a bug in NativeViewHostGtk - reparenting needs to be done atomically using gtk_widget_reparent since GtkWidgets are refcounted and when removed from a container are released, causing a crash when a TabContents is reparented. The code now compiles thanks to a stubbed BlockedPopupContainer, however there is one remaining issue - the browser window no longer paints and the app instantly hangs. However this is better than the current state so I figured I'd send the code review. Review URL: http://codereview.chromium.org/126107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button')
-rw-r--r--views/controls/button/native_button_gtk.cc8
-rw-r--r--views/controls/button/native_button_gtk.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc
index c97d1e0..1680019 100644
--- a/views/controls/button/native_button_gtk.cc
+++ b/views/controls/button/native_button_gtk.cc
@@ -83,7 +83,7 @@ gfx::Size NativeButtonGtk::GetPreferredSize() {
void NativeButtonGtk::CreateNativeControl() {
GtkWidget* widget = gtk_button_new();
g_signal_connect(G_OBJECT(widget), "clicked",
- G_CALLBACK(CallClicked), NULL);
+ G_CALLBACK(CallClicked), this);
NativeControlCreated(widget);
}
@@ -96,10 +96,8 @@ void NativeButtonGtk::NativeControlCreated(GtkWidget* widget) {
}
// static
-void NativeButtonGtk::CallClicked(GtkButton* widget) {
- View* view = NativeViewHostGtk::GetViewForNative(GTK_WIDGET(widget));
- if (view)
- static_cast<NativeButtonGtk*>(view)->OnClicked();
+void NativeButtonGtk::CallClicked(GtkButton* widget, NativeButtonGtk* button) {
+ button->OnClicked();
}
void NativeButtonGtk::OnClicked() {
diff --git a/views/controls/button/native_button_gtk.h b/views/controls/button/native_button_gtk.h
index e719202..6c3f600 100644
--- a/views/controls/button/native_button_gtk.h
+++ b/views/controls/button/native_button_gtk.h
@@ -36,7 +36,7 @@ class NativeButtonGtk : public NativeControlGtk, public NativeButtonWrapper {
virtual bool IsCheckbox() const { return false; }
private:
- static void CallClicked(GtkButton* widget);
+ static void CallClicked(GtkButton* widget, NativeButtonGtk* button);
// Invoked when the user clicks on the button.
void OnClicked();