Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: chrome/browser/ui/gtk/download/download_item_gtk.cc

Issue 8016001: Browser crashes while closing download shelf if menu is open (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/download/download_item_gtk.h" 5 #include "chrome/browser/ui/gtk/download/download_item_gtk.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 gtk_widget_set_size_request(body_.get(), kMinDownloadItemWidth, -1); 259 gtk_widget_set_size_request(body_.get(), kMinDownloadItemWidth, -1);
260 } 260 }
261 261
262 new_item_animation_->Show(); 262 new_item_animation_->Show();
263 263
264 complete_animation_.SetTweenType(ui::Tween::LINEAR); 264 complete_animation_.SetTweenType(ui::Tween::LINEAR);
265 complete_animation_.SetSlideDuration(kCompleteAnimationDurationMs); 265 complete_animation_.SetSlideDuration(kCompleteAnimationDurationMs);
266 } 266 }
267 267
268 DownloadItemGtk::~DownloadItemGtk() { 268 DownloadItemGtk::~DownloadItemGtk() {
269 // First close the menu and then destroy the GtkWidgets. Bug#97724
270 if (menu_.get())
271 menu_.reset();
272
269 icon_consumer_.CancelAllRequests(); 273 icon_consumer_.CancelAllRequests();
270 StopDownloadProgress(); 274 StopDownloadProgress();
271 get_download()->RemoveObserver(this); 275 get_download()->RemoveObserver(this);
272 276
273 // We may free some shelf space for showing more download items. 277 // We may free some shelf space for showing more download items.
274 parent_shelf_->MaybeShowMoreDownloadItems(); 278 parent_shelf_->MaybeShowMoreDownloadItems();
275 279
276 hbox_.Destroy(); 280 hbox_.Destroy();
277 progress_area_.Destroy(); 281 progress_area_.Destroy();
278 body_.Destroy(); 282 body_.Destroy();
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 get_download()->DangerousDownloadValidated(); 878 get_download()->DangerousDownloadValidated();
875 } 879 }
876 880
877 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { 881 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) {
878 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 882 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
879 base::Time::Now() - creation_time_); 883 base::Time::Now() - creation_time_);
880 if (get_download()->IsPartialDownload()) 884 if (get_download()->IsPartialDownload())
881 get_download()->Cancel(true); 885 get_download()->Cancel(true);
882 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 886 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
883 } 887 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698