summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/download_item_gtk.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 01:10:46 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 01:10:46 +0000
commit9ba163874e45d59edd638ea5b309e125b81ae4ea (patch)
tree8d578f04d42f9bb35616f5f9d92e8a6cc09e47ac /chrome/browser/gtk/download_item_gtk.cc
parent680f734ea3b0df9326f10e6e08d87105287171ea (diff)
downloadchromium_src-9ba163874e45d59edd638ea5b309e125b81ae4ea.zip
chromium_src-9ba163874e45d59edd638ea5b309e125b81ae4ea.tar.gz
chromium_src-9ba163874e45d59edd638ea5b309e125b81ae4ea.tar.bz2
Fix a couple problems with DownloadItemGtk.
1) We were crashing after removing a download item because g_signal_handler_find() was not working as expected. 2) We had a graphical glitch with the dangerous download dialog because GtkAlignments doesn't normally redraw on allocate. BUG=13659 Review URL: http://codereview.chromium.org/118403 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/download_item_gtk.cc')
-rw-r--r--chrome/browser/gtk/download_item_gtk.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc
index a411cb6..cab2faa 100644
--- a/chrome/browser/gtk/download_item_gtk.cc
+++ b/chrome/browser/gtk/download_item_gtk.cc
@@ -330,6 +330,7 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf,
gtk_box_pack_start(GTK_BOX(hbox_.get()), dangerous_prompt_, FALSE, FALSE,
0);
gtk_widget_set_app_paintable(dangerous_prompt_, TRUE);
+ gtk_widget_set_redraw_on_allocate(dangerous_prompt_, TRUE);
g_signal_connect(dangerous_prompt_, "expose-event",
G_CALLBACK(OnDangerousPromptExpose), this);
gtk_widget_show_all(dangerous_prompt_);
@@ -347,18 +348,6 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf,
DownloadItemGtk::~DownloadItemGtk() {
StopDownloadProgress();
-
- // If the top-level window was already destroyed, the signal handler was
- // already disconnected. Disconnect if that's not the case.
- if (g_signal_handler_find(parent_shelf_->GetHBox(),
- G_SIGNAL_MATCH_ID,
- resize_handler_id_,
- 0,
- NULL,
- NULL,
- NULL) != 0) {
- g_signal_handler_disconnect(parent_shelf_->GetHBox(), resize_handler_id_);
- }
get_download()->RemoveObserver(this);
hbox_.Destroy();
@@ -379,6 +368,9 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) {
switch (download->state()) {
case DownloadItem::REMOVING:
+ // We disconnect here rather than the d'tor because we don't want to
+ // explicitly disconnect if |parent_shelf_| has been destroyed.
+ g_signal_handler_disconnect(parent_shelf_->GetHBox(), resize_handler_id_);
parent_shelf_->RemoveDownloadItem(this); // This will delete us!
return;
case DownloadItem::CANCELLED: