OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/volume_bubble.h" | 5 #include "chrome/browser/chromeos/volume_bubble.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 | 8 |
9 #include "base/timer.h" | 9 #include "base/timer.h" |
10 #include "chrome/browser/chromeos/volume_bubble_view.h" | 10 #include "chrome/browser/chromeos/volume_bubble_view.h" |
11 #include "chrome/browser/views/info_bubble.h" | 11 #include "chrome/browser/views/info_bubble.h" |
12 #include "views/widget/root_view.h" | 12 #include "views/widget/root_view.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const int kBubbleShowTimeoutSec = 2; | 16 const int kBubbleShowTimeoutSec = 2; |
17 const int kAnimationDurationMs = 200; | 17 const int kAnimationDurationMs = 200; |
18 | 18 |
19 // Horizontal relative position: 0 - leftmost, 0.5 - center, 1 - rightmost. | 19 // Horizontal relative position: 0 - leftmost, 0.5 - center, 1 - rightmost. |
20 const double kVolumeBubbleXRatio = 0.18; | 20 const double kVolumeBubbleXRatio = 0.5; |
21 | 21 |
22 // Vertical gap from the bottom of the screen in pixels. | 22 // Vertical gap from the bottom of the screen in pixels. |
23 const int kVolumeBubbleBottomGap = 30; | 23 const int kVolumeBubbleBottomGap = 30; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 namespace chromeos { | 27 namespace chromeos { |
28 | 28 |
29 // Temporary helper routine. Returns currently shown Chrome widget or NULL. | 29 // Temporary helper routine. Returns currently shown Chrome widget or NULL. |
30 // TODO(glotov): remove this in favor of enabling InfoBubble class act | 30 // TODO(glotov): remove this in favor of enabling InfoBubble class act |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 void VolumeBubble::AnimationProgressed(const Animation* animation) { | 117 void VolumeBubble::AnimationProgressed(const Animation* animation) { |
118 if (view_) { | 118 if (view_) { |
119 view_->Update( | 119 view_->Update( |
120 Tween::ValueBetween(animation->GetCurrentValue(), | 120 Tween::ValueBetween(animation->GetCurrentValue(), |
121 previous_percent_, | 121 previous_percent_, |
122 current_percent_)); | 122 current_percent_)); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 } // namespace chromeos | 126 } // namespace chromeos |
OLD | NEW |