| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |