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> |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 normal_body_image_set_.top_left->height() + | 210 normal_body_image_set_.top_left->height() + |
211 normal_body_image_set_.bottom_left->height()); | 211 normal_body_image_set_.bottom_left->height()); |
212 | 212 |
213 box_y_ = std::max(0, (2 * kProgressPadding + | 213 box_y_ = std::max(0, (2 * kProgressPadding + |
214 DownloadShelf::kProgressIndicatorSize - box_height_) / | 214 DownloadShelf::kProgressIndicatorSize - box_height_) / |
215 2); | 215 2); |
216 | 216 |
217 body_hover_animation_.reset(new gfx::SlideAnimation(this)); | 217 body_hover_animation_.reset(new gfx::SlideAnimation(this)); |
218 drop_hover_animation_.reset(new gfx::SlideAnimation(this)); | 218 drop_hover_animation_.reset(new gfx::SlideAnimation(this)); |
219 | 219 |
220 SetAccessibilityFocusable(true); | 220 SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); |
221 | 221 |
222 OnDownloadUpdated(download()); | 222 OnDownloadUpdated(download()); |
223 UpdateDropDownButtonPosition(); | 223 UpdateDropDownButtonPosition(); |
224 } | 224 } |
225 | 225 |
226 DownloadItemView::~DownloadItemView() { | 226 DownloadItemView::~DownloadItemView() { |
227 StopDownloadProgress(); | 227 StopDownloadProgress(); |
228 download()->RemoveObserver(this); | 228 download()->RemoveObserver(this); |
229 | 229 |
230 // ExperienceSampling: If the user took no action to remove the warning | 230 // ExperienceSampling: If the user took no action to remove the warning |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1363 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1364 } | 1364 } |
1365 } | 1365 } |
1366 | 1366 |
1367 void DownloadItemView::ProgressTimerFired() { | 1367 void DownloadItemView::ProgressTimerFired() { |
1368 // Only repaint for the indeterminate size case. Otherwise, we'll repaint only | 1368 // Only repaint for the indeterminate size case. Otherwise, we'll repaint only |
1369 // when there's an update notified via OnDownloadUpdated(). | 1369 // when there's an update notified via OnDownloadUpdated(). |
1370 if (model_.PercentComplete() < 0) | 1370 if (model_.PercentComplete() < 0) |
1371 SchedulePaint(); | 1371 SchedulePaint(); |
1372 } | 1372 } |
OLD | NEW |