summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 01:23:55 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 01:23:55 +0000
commit6fa12b900668e7764f834a631b23a53e03205692 (patch)
treef8db9e37ee88d0396e80e7e670cc82213879cc6f /chrome/browser/gtk
parent73c59792bc9d2462b71aeafa22fd26ee8d5c37ac (diff)
downloadchromium_src-6fa12b900668e7764f834a631b23a53e03205692.zip
chromium_src-6fa12b900668e7764f834a631b23a53e03205692.tar.gz
chromium_src-6fa12b900668e7764f834a631b23a53e03205692.tar.bz2
GTK: avoid a dcheck
don't use an OwnedWidgetGtk for GtkWindows, which are no longer floating by the time the constructor returns. BUG=42807 TEST=launch a debug build in a compositing window manager Review URL: http://codereview.chromium.org/1795009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.cc17
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.h2
2 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index c9adf88..6b73f34 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -154,6 +154,7 @@ LocationBarViewGtk::LocationBarViewGtk(Browser* browser)
site_type_alignment_(NULL),
site_type_event_box_(NULL),
location_icon_image_(NULL),
+ drag_icon_(NULL),
enable_location_drag_(false),
security_info_label_(NULL),
tab_to_search_box_(NULL),
@@ -181,7 +182,8 @@ LocationBarViewGtk::~LocationBarViewGtk() {
// All of our widgets should have be children of / owned by the alignment.
star_.Destroy();
hbox_.Destroy();
- drag_icon_.Destroy();
+ if (drag_icon_)
+ g_object_unref(drag_icon_);
content_setting_hbox_.Destroy();
page_action_hbox_.Destroy();
}
@@ -415,17 +417,18 @@ void LocationBarViewGtk::SetSiteTypeDragSource() {
g_signal_connect(site_type_event_box_, "drag-begin",
G_CALLBACK(&OnIconDragBeginThunk), this);
- drag_icon_.Own(gtk_window_new(GTK_WINDOW_POPUP));
- g_signal_connect(drag_icon_.get(), "expose-event",
+ drag_icon_ = gtk_window_new(GTK_WINDOW_POPUP);
+ g_object_ref(drag_icon_);
+ g_signal_connect(drag_icon_, "expose-event",
G_CALLBACK(OnDragIconExposeThunk), this);
- GdkScreen* screen = gtk_widget_get_screen(drag_icon_.get());
+ GdkScreen* screen = gtk_widget_get_screen(drag_icon_);
GdkColormap* rgba = gdk_screen_get_rgba_colormap(screen);
if (rgba)
- gtk_widget_set_colormap(drag_icon_.get(), rgba);
+ gtk_widget_set_colormap(drag_icon_, rgba);
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
- gtk_widget_set_size_request(drag_icon_.get(), 200, base_font.height());
+ gtk_widget_set_size_request(drag_icon_, 200, base_font.height());
}
void LocationBarViewGtk::SetProfile(Profile* profile) {
@@ -987,7 +990,7 @@ void LocationBarViewGtk::OnIconDragData(GtkWidget* sender,
void LocationBarViewGtk::OnIconDragBegin(GtkWidget* sender,
GdkDragContext* context) {
if (gtk_util::IsScreenComposited())
- gtk_drag_set_icon_widget(context, drag_icon_.get(), 0, 0);
+ gtk_drag_set_icon_widget(context, drag_icon_, 0, 0);
}
gboolean LocationBarViewGtk::OnDragIconExpose(GtkWidget* sender,
diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h
index baa7e4a..6f21c74 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.h
+++ b/chrome/browser/gtk/location_bar_view_gtk.h
@@ -337,7 +337,7 @@ class LocationBarViewGtk : public AutocompleteEditController,
GtkWidget* site_type_alignment_;
GtkWidget* site_type_event_box_;
GtkWidget* location_icon_image_;
- OwnedWidgetGtk drag_icon_;
+ GtkWidget* drag_icon_;
bool enable_location_drag_;
// TODO(pkasting): Split this label off and move the rest of the items to the
// left of the address bar.