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

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

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/gtk/download_item_gtk.h" 5 #include "chrome/browser/gtk/download_item_gtk.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "app/slide_animation.h" 9 #include "app/slide_animation.h"
10 #include "app/text_elider.h" 10 #include "app/text_elider.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 LoadIcon(); 345 LoadIcon();
346 346
347 UpdateTooltip(); 347 UpdateTooltip();
348 } 348 }
349 349
350 switch (download->state()) { 350 switch (download->state()) {
351 case DownloadItem::REMOVING: 351 case DownloadItem::REMOVING:
352 parent_shelf_->RemoveDownloadItem(this); // This will delete us! 352 parent_shelf_->RemoveDownloadItem(this); // This will delete us!
353 return; 353 return;
354 case DownloadItem::CANCELLED: 354 case DownloadItem::CANCELLED:
355 case DownloadItem::INTERRUPTED:
355 StopDownloadProgress(); 356 StopDownloadProgress();
356 gtk_widget_queue_draw(progress_area_.get()); 357 gtk_widget_queue_draw(progress_area_.get());
357 break; 358 break;
358 case DownloadItem::COMPLETE: 359 case DownloadItem::COMPLETE:
359 if (download->auto_opened()) { 360 if (download->auto_opened()) {
360 parent_shelf_->RemoveDownloadItem(this); // This will delete us! 361 parent_shelf_->RemoveDownloadItem(this); // This will delete us!
361 return; 362 return;
362 } 363 }
363 StopDownloadProgress(); 364 StopDownloadProgress();
364 365
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 849
849 void DownloadItemGtk::OnDangerousAccept(GtkWidget* button) { 850 void DownloadItemGtk::OnDangerousAccept(GtkWidget* button) {
850 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", 851 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download",
851 base::Time::Now() - creation_time_); 852 base::Time::Now() - creation_time_);
852 get_download()->DangerousDownloadValidated(); 853 get_download()->DangerousDownloadValidated();
853 } 854 }
854 855
855 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { 856 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) {
856 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 857 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
857 base::Time::Now() - creation_time_); 858 base::Time::Now() - creation_time_);
858 if (get_download()->state() == DownloadItem::IN_PROGRESS) 859 if (get_download()->IsPartialDownload())
859 get_download()->Cancel(true); 860 get_download()->Cancel(true);
860 get_download()->Remove(true); 861 get_download()->Remove(true);
861 } 862 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698