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/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/i18n/break_iterator.h" | 15 #include "base/i18n/break_iterator.h" |
16 #include "base/i18n/rtl.h" | 16 #include "base/i18n/rtl.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/prefs/pref_service.h" | |
20 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
21 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
22 #include "base/strings/sys_string_conversions.h" | 21 #include "base/strings/sys_string_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
24 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 24 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
26 #include "chrome/browser/download/download_item_model.h" | 25 #include "chrome/browser/download/download_item_model.h" |
27 #include "chrome/browser/download/download_stats.h" | 26 #include "chrome/browser/download/download_stats.h" |
28 #include "chrome/browser/download/drag_download_item.h" | 27 #include "chrome/browser/download/drag_download_item.h" |
29 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s
ampling.h" | 28 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s
ampling.h" |
30 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
31 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 30 #include "chrome/browser/safe_browsing/download_feedback_service.h" |
32 #include "chrome/browser/safe_browsing/download_protection_service.h" | 31 #include "chrome/browser/safe_browsing/download_protection_service.h" |
33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 32 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
34 #include "chrome/browser/themes/theme_properties.h" | 33 #include "chrome/browser/themes/theme_properties.h" |
35 #include "chrome/browser/ui/views/download/download_feedback_dialog_view.h" | 34 #include "chrome/browser/ui/views/download/download_feedback_dialog_view.h" |
36 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" | 35 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" |
37 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 36 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
38 #include "chrome/browser/ui/views/frame/browser_view.h" | 37 #include "chrome/browser/ui/views/frame/browser_view.h" |
39 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
40 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
| 40 #include "components/prefs/pref_service.h" |
41 #include "content/public/browser/download_danger_type.h" | 41 #include "content/public/browser/download_danger_type.h" |
42 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
43 #include "third_party/icu/source/common/unicode/uchar.h" | 43 #include "third_party/icu/source/common/unicode/uchar.h" |
44 #include "ui/accessibility/ax_view_state.h" | 44 #include "ui/accessibility/ax_view_state.h" |
45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
47 #include "ui/base/theme_provider.h" | 47 #include "ui/base/theme_provider.h" |
48 #include "ui/events/event.h" | 48 #include "ui/events/event.h" |
49 #include "ui/gfx/animation/slide_animation.h" | 49 #include "ui/gfx/animation/slide_animation.h" |
50 #include "ui/gfx/canvas.h" | 50 #include "ui/gfx/canvas.h" |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1385 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1386 } | 1386 } |
1387 } | 1387 } |
1388 | 1388 |
1389 void DownloadItemView::ProgressTimerFired() { | 1389 void DownloadItemView::ProgressTimerFired() { |
1390 // Only repaint for the indeterminate size case. Otherwise, we'll repaint only | 1390 // Only repaint for the indeterminate size case. Otherwise, we'll repaint only |
1391 // when there's an update notified via OnDownloadUpdated(). | 1391 // when there's an update notified via OnDownloadUpdated(). |
1392 if (model_.PercentComplete() < 0) | 1392 if (model_.PercentComplete() < 0) |
1393 SchedulePaint(); | 1393 SchedulePaint(); |
1394 } | 1394 } |
OLD | NEW |