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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 normal_body_image_set_.bottom_left->height()); | 198 normal_body_image_set_.bottom_left->height()); |
199 | 199 |
200 if (DownloadShelf::kSmallProgressIconSize > box_height_) | 200 if (DownloadShelf::kSmallProgressIconSize > box_height_) |
201 box_y_ = (DownloadShelf::kSmallProgressIconSize - box_height_) / 2; | 201 box_y_ = (DownloadShelf::kSmallProgressIconSize - box_height_) / 2; |
202 else | 202 else |
203 box_y_ = 0; | 203 box_y_ = 0; |
204 | 204 |
205 body_hover_animation_.reset(new gfx::SlideAnimation(this)); | 205 body_hover_animation_.reset(new gfx::SlideAnimation(this)); |
206 drop_hover_animation_.reset(new gfx::SlideAnimation(this)); | 206 drop_hover_animation_.reset(new gfx::SlideAnimation(this)); |
207 | 207 |
208 set_accessibility_focusable(true); | 208 SetAccessibilityFocusable(true); |
209 | 209 |
210 OnDownloadUpdated(download()); | 210 OnDownloadUpdated(download()); |
211 UpdateDropDownButtonPosition(); | 211 UpdateDropDownButtonPosition(); |
212 } | 212 } |
213 | 213 |
214 DownloadItemView::~DownloadItemView() { | 214 DownloadItemView::~DownloadItemView() { |
215 StopDownloadProgress(); | 215 StopDownloadProgress(); |
216 download()->RemoveObserver(this); | 216 download()->RemoveObserver(this); |
217 } | 217 } |
218 | 218 |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 void DownloadItemView::AnimateStateTransition(State from, State to, | 1315 void DownloadItemView::AnimateStateTransition(State from, State to, |
1316 gfx::SlideAnimation* animation) { | 1316 gfx::SlideAnimation* animation) { |
1317 if (from == NORMAL && to == HOT) { | 1317 if (from == NORMAL && to == HOT) { |
1318 animation->Show(); | 1318 animation->Show(); |
1319 } else if (from == HOT && to == NORMAL) { | 1319 } else if (from == HOT && to == NORMAL) { |
1320 animation->Hide(); | 1320 animation->Hide(); |
1321 } else if (from != to) { | 1321 } else if (from != to) { |
1322 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1322 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1323 } | 1323 } |
1324 } | 1324 } |
OLD | NEW |