OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/toolbar/wrench_icon_painter.h" | 5 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
10 #include "ui/base/theme_provider.h" | 10 #include "ui/base/theme_provider.h" |
11 #include "ui/gfx/animation/multi_animation.h" | 11 #include "ui/gfx/animation/multi_animation.h" |
12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
14 #include "ui/gfx/rect.h" | |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // The wrench icon is made up of this many bars stacked vertically. | 18 // The wrench icon is made up of this many bars stacked vertically. |
19 const int kBarCount = 3; | 19 const int kBarCount = 3; |
20 | 20 |
21 // |value| is the animation progress from 0 to 1. |index| is the index of the | 21 // |value| is the animation progress from 0 to 1. |index| is the index of the |
22 // bar being drawn. This function returns a new progress value (from 0 to 1) | 22 // bar being drawn. This function returns a new progress value (from 0 to 1) |
23 // such that bars appear staggered. | 23 // such that bars appear staggered. |
24 double GetStaggeredValue(double value, int index) { | 24 double GetStaggeredValue(double value, int index) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 case SEVERITY_LOW: | 139 case SEVERITY_LOW: |
140 return IDR_TOOLS_BAR_LOW; | 140 return IDR_TOOLS_BAR_LOW; |
141 case SEVERITY_MEDIUM: | 141 case SEVERITY_MEDIUM: |
142 return IDR_TOOLS_BAR_MEDIUM; | 142 return IDR_TOOLS_BAR_MEDIUM; |
143 case SEVERITY_HIGH: | 143 case SEVERITY_HIGH: |
144 return IDR_TOOLS_BAR_HIGH; | 144 return IDR_TOOLS_BAR_HIGH; |
145 } | 145 } |
146 NOTREACHED(); | 146 NOTREACHED(); |
147 return 0; | 147 return 0; |
148 } | 148 } |
OLD | NEW |