OLD | NEW |
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_item_gtk.h" | 5 #include "chrome/browser/ui/gtk/download_item_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 gtk_widget_show_all(hbox_.get()); | 349 gtk_widget_show_all(hbox_.get()); |
350 gtk_widget_destroy(dangerous_prompt_); | 350 gtk_widget_destroy(dangerous_prompt_); |
351 gtk_widget_set_size_request(body_.get(), kBodyWidth, -1); | 351 gtk_widget_set_size_request(body_.get(), kBodyWidth, -1); |
352 dangerous_prompt_ = NULL; | 352 dangerous_prompt_ = NULL; |
353 | 353 |
354 // We may free some shelf space for showing more download items. | 354 // We may free some shelf space for showing more download items. |
355 parent_shelf_->MaybeShowMoreDownloadItems(); | 355 parent_shelf_->MaybeShowMoreDownloadItems(); |
356 } | 356 } |
357 | 357 |
358 if (download->GetUserVerifiedFilePath() != icon_filepath_) { | 358 if (download->GetUserVerifiedFilePath() != icon_filepath_) { |
359 // Turns out the file path is "unconfirmed %d.crdownload" for dangerous | 359 // Turns out the file path is "Unconfirmed %d.crdownload" for dangerous |
360 // downloads. When the download is confirmed, the file is renamed on | 360 // downloads. When the download is confirmed, the file is renamed on |
361 // another thread, so reload the icon if the download filename changes. | 361 // another thread, so reload the icon if the download filename changes. |
362 LoadIcon(); | 362 LoadIcon(); |
363 | 363 |
364 UpdateTooltip(); | 364 UpdateTooltip(); |
365 } | 365 } |
366 | 366 |
367 switch (download->state()) { | 367 switch (download->state()) { |
368 case DownloadItem::REMOVING: | 368 case DownloadItem::REMOVING: |
369 parent_shelf_->RemoveDownloadItem(this); // This will delete us! | 369 parent_shelf_->RemoveDownloadItem(this); // This will delete us! |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 get_download()->DangerousDownloadValidated(); | 870 get_download()->DangerousDownloadValidated(); |
871 } | 871 } |
872 | 872 |
873 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { | 873 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { |
874 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 874 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
875 base::Time::Now() - creation_time_); | 875 base::Time::Now() - creation_time_); |
876 if (get_download()->state() == DownloadItem::IN_PROGRESS) | 876 if (get_download()->state() == DownloadItem::IN_PROGRESS) |
877 get_download()->Cancel(true); | 877 get_download()->Cancel(true); |
878 get_download()->Remove(true); | 878 get_download()->Remove(true); |
879 } | 879 } |
OLD | NEW |