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 #ifndef CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
11 #include "chrome/browser/ui/views/bubble/bubble.h" | 11 #include "chrome/browser/ui/views/bubble/bubble.h" |
12 #include "ui/base/animation/animation_delegate.h" | 12 #include "ui/base/animation/animation_delegate.h" |
13 #include "ui/base/animation/slide_animation.h" | 13 #include "ui/base/animation/slide_animation.h" |
14 | 14 |
15 class SkBitmap; | 15 class SkBitmap; |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 class SettingLevelBubbleView; | 19 class SettingLevelBubbleView; |
20 | 20 |
21 // Singleton class controlling a bubble displaying a level-based setting like | 21 // Singleton class controlling a bubble displaying a level-based setting like |
22 // volume or brightness. | 22 // volume or brightness. |
23 class SettingLevelBubble : public BubbleDelegate, | 23 class SettingLevelBubble : public BubbleDelegate, |
24 public ui::AnimationDelegate { | 24 public ui::AnimationDelegate { |
25 public: | 25 public: |
26 void ShowBubble(int percent); | 26 void ShowBubble(int percent); |
27 void HideBubble(); | 27 void HideBubble(); |
| 28 bool IsShown() const; |
28 | 29 |
29 // Update the bubble's current level without showing the bubble onscreen. | 30 // Update the bubble's current level without showing the bubble onscreen. |
30 // We _do_ still animate the level moving to |percent| in case the bubble is | 31 // We _do_ still animate the level moving to |percent| in case the bubble is |
31 // still visible from a previous call to ShowBubble(). | 32 // still visible from a previous call to ShowBubble(). |
32 // | 33 // |
33 // This can be used when the setting has been changed automatically and we | 34 // This can be used when the setting has been changed automatically and we |
34 // want to make sure that it's animated from the correct position the next | 35 // want to make sure that it's animated from the correct position the next |
35 // time that the bubble is shown. For example: | 36 // time that the bubble is shown. For example: |
36 // | 37 // |
37 // 1. Brightness is at 50%. | 38 // 1. Brightness is at 50%. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 80 |
80 ui::SlideAnimation animation_; | 81 ui::SlideAnimation animation_; |
81 base::OneShotTimer<SettingLevelBubble> timeout_timer_; | 82 base::OneShotTimer<SettingLevelBubble> timeout_timer_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubble); | 84 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubble); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace chromeos | 87 } // namespace chromeos |
87 | 88 |
88 #endif // CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_SETTING_LEVEL_BUBBLE_H_ |
OLD | NEW |