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/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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 void DownloadItemGtk::UpdateDownloadProgress() { | 417 void DownloadItemGtk::UpdateDownloadProgress() { |
418 progress_angle_ = (progress_angle_ + | 418 progress_angle_ = (progress_angle_ + |
419 download_util::kUnknownIncrementDegrees) % | 419 download_util::kUnknownIncrementDegrees) % |
420 download_util::kMaxDegrees; | 420 download_util::kMaxDegrees; |
421 gtk_widget_queue_draw(progress_area_.get()); | 421 gtk_widget_queue_draw(progress_area_.get()); |
422 } | 422 } |
423 | 423 |
424 void DownloadItemGtk::StartDownloadProgress() { | 424 void DownloadItemGtk::StartDownloadProgress() { |
425 if (progress_timer_.IsRunning()) | 425 if (progress_timer_.IsRunning()) |
426 return; | 426 return; |
427 progress_timer_.Start(FROM_HERE, | 427 progress_timer_.Start( |
428 base::TimeDelta::FromMilliseconds(download_util::kProgressRateMs), this, | 428 base::TimeDelta::FromMilliseconds(download_util::kProgressRateMs), this, |
429 &DownloadItemGtk::UpdateDownloadProgress); | 429 &DownloadItemGtk::UpdateDownloadProgress); |
430 } | 430 } |
431 | 431 |
432 void DownloadItemGtk::StopDownloadProgress() { | 432 void DownloadItemGtk::StopDownloadProgress() { |
433 progress_timer_.Stop(); | 433 progress_timer_.Stop(); |
434 } | 434 } |
435 | 435 |
436 // Icon loading functions. | 436 // Icon loading functions. |
437 | 437 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 get_download()->DangerousDownloadValidated(); | 874 get_download()->DangerousDownloadValidated(); |
875 } | 875 } |
876 | 876 |
877 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { | 877 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { |
878 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 878 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
879 base::Time::Now() - creation_time_); | 879 base::Time::Now() - creation_time_); |
880 if (get_download()->IsPartialDownload()) | 880 if (get_download()->IsPartialDownload()) |
881 get_download()->Cancel(true); | 881 get_download()->Cancel(true); |
882 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); | 882 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); |
883 } | 883 } |
OLD | NEW |