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

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

Issue 14947007: [Downloads] Allow acquiring dangerous download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods for consistency Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 if (!theme_service_->UsingNativeTheme()) { 915 if (!theme_service_->UsingNativeTheme()) {
916 // The hbox renderer will take care of the border when in GTK mode. 916 // The hbox renderer will take care of the border when in GTK mode.
917 dangerous_nine_box_->RenderToWidget(widget); 917 dangerous_nine_box_->RenderToWidget(widget);
918 } 918 }
919 return FALSE; // Continue propagation. 919 return FALSE; // Continue propagation.
920 } 920 }
921 921
922 void DownloadItemGtk::OnDangerousAccept(GtkWidget* button) { 922 void DownloadItemGtk::OnDangerousAccept(GtkWidget* button) {
923 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", 923 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download",
924 base::Time::Now() - creation_time_); 924 base::Time::Now() - creation_time_);
925 download()->DangerousDownloadValidated(); 925 download()->ValidateDangerousDownload();
926 } 926 }
927 927
928 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { 928 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) {
929 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 929 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
930 base::Time::Now() - creation_time_); 930 base::Time::Now() - creation_time_);
931 if (download()->IsPartialDownload()) 931 if (download()->IsPartialDownload())
932 download()->Cancel(true); 932 download()->Cancel(true);
933 download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 933 download()->DiscardDangerousDownload(DownloadItem::DELETE_DUE_TO_USER_DISCARD,
934 DownloadItem::AcquireFileCallback());
934 } 935 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698