OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/download/download_started_animation.h" | 5 #include "chrome/browser/download/download_started_animation.h" |
6 | 6 |
7 #include "content/browser/tab_contents/tab_contents.h" | 7 #include "content/browser/tab_contents/tab_contents.h" |
8 #include "content/public/browser/notification_details.h" | 8 #include "content/public/browser/notification_details.h" |
9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
11 #include "content/public/browser/notification_types.h" | 11 #include "content/public/browser/notification_types.h" |
12 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
13 #include "ui/base/animation/linear_animation.h" | 13 #include "ui/base/animation/linear_animation.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/views/widget/widget.h" | |
17 #include "views/controls/image_view.h" | 16 #include "views/controls/image_view.h" |
| 17 #include "views/widget/widget.h" |
18 | 18 |
19 // How long to spend moving downwards and fading out after waiting. | 19 // How long to spend moving downwards and fading out after waiting. |
20 static const int kMoveTimeMs = 600; | 20 static const int kMoveTimeMs = 600; |
21 | 21 |
22 // The animation framerate. | 22 // The animation framerate. |
23 static const int kFrameRateHz = 60; | 23 static const int kFrameRateHz = 60; |
24 | 24 |
25 // What fraction of the frame height to move downward from the frame center. | 25 // What fraction of the frame height to move downward from the frame center. |
26 // Note that setting this greater than 0.5 will mean moving past the bottom of | 26 // Note that setting this greater than 0.5 will mean moving past the bottom of |
27 // the frame. | 27 // the frame. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 } // namespace | 177 } // namespace |
178 | 178 |
179 // static | 179 // static |
180 void DownloadStartedAnimation::Show(TabContents* tab_contents) { | 180 void DownloadStartedAnimation::Show(TabContents* tab_contents) { |
181 // The animation will delete itself when it's finished or when the tab | 181 // The animation will delete itself when it's finished or when the tab |
182 // contents is hidden or destroyed. | 182 // contents is hidden or destroyed. |
183 new DownloadStartedAnimationWin(tab_contents); | 183 new DownloadStartedAnimationWin(tab_contents); |
184 } | 184 } |
OLD | NEW |