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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "ui/views/controls/button/label_button.h" | 44 #include "ui/views/controls/button/label_button.h" |
45 #include "ui/views/controls/label.h" | 45 #include "ui/views/controls/label.h" |
46 #include "ui/views/widget/root_view.h" | 46 #include "ui/views/widget/root_view.h" |
47 #include "ui/views/widget/widget.h" | 47 #include "ui/views/widget/widget.h" |
48 | 48 |
49 // TODO(paulg): These may need to be adjusted when download progress | 49 // TODO(paulg): These may need to be adjusted when download progress |
50 // animation is added, and also possibly to take into account | 50 // animation is added, and also possibly to take into account |
51 // different screen resolutions. | 51 // different screen resolutions. |
52 static const int kTextWidth = 140; // Pixels | 52 static const int kTextWidth = 140; // Pixels |
53 static const int kDangerousTextWidth = 200; // Pixels | 53 static const int kDangerousTextWidth = 200; // Pixels |
54 static const int kHorizontalTextPadding = 2; // Pixels | |
55 static const int kVerticalPadding = 3; // Pixels | 54 static const int kVerticalPadding = 3; // Pixels |
56 static const int kVerticalTextSpacer = 2; // Pixels | |
57 static const int kVerticalTextPadding = 2; // Pixels | 55 static const int kVerticalTextPadding = 2; // Pixels |
58 static const int kTooltipMaxWidth = 800; // Pixels | 56 static const int kTooltipMaxWidth = 800; // Pixels |
59 | 57 |
60 // We add some padding before the left image so that the progress animation icon | 58 // We add some padding before the left image so that the progress animation icon |
61 // hides the corners of the left image. | 59 // hides the corners of the left image. |
62 static const int kLeftPadding = 0; // Pixels. | 60 static const int kLeftPadding = 0; // Pixels. |
63 | 61 |
64 // The space between the Save and Discard buttons when prompting for a dangerous | 62 // The space between the Save and Discard buttons when prompting for a dangerous |
65 // download. | 63 // download. |
66 static const int kButtonPadding = 5; // Pixels. | 64 static const int kButtonPadding = 5; // Pixels. |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 void DownloadItemView::AnimateStateTransition(State from, State to, | 1264 void DownloadItemView::AnimateStateTransition(State from, State to, |
1267 gfx::SlideAnimation* animation) { | 1265 gfx::SlideAnimation* animation) { |
1268 if (from == NORMAL && to == HOT) { | 1266 if (from == NORMAL && to == HOT) { |
1269 animation->Show(); | 1267 animation->Show(); |
1270 } else if (from == HOT && to == NORMAL) { | 1268 } else if (from == HOT && to == NORMAL) { |
1271 animation->Hide(); | 1269 animation->Hide(); |
1272 } else if (from != to) { | 1270 } else if (from != to) { |
1273 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1271 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1274 } | 1272 } |
1275 } | 1273 } |
OLD | NEW |