| 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 void DownloadItemView::AnimateStateTransition(State from, State to, | 1295 void DownloadItemView::AnimateStateTransition(State from, State to, |
| 1296 gfx::SlideAnimation* animation) { | 1296 gfx::SlideAnimation* animation) { |
| 1297 if (from == NORMAL && to == HOT) { | 1297 if (from == NORMAL && to == HOT) { |
| 1298 animation->Show(); | 1298 animation->Show(); |
| 1299 } else if (from == HOT && to == NORMAL) { | 1299 } else if (from == HOT && to == NORMAL) { |
| 1300 animation->Hide(); | 1300 animation->Hide(); |
| 1301 } else if (from != to) { | 1301 } else if (from != to) { |
| 1302 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1302 animation->Reset((to == HOT) ? 1.0 : 0.0); |
| 1303 } | 1303 } |
| 1304 } | 1304 } |
| OLD | NEW |