Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/browser/chromeos/setting_level_bubble.cc

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/setting_level_bubble.h" 5 #include "chrome/browser/chromeos/setting_level_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/browser_list.h" 10 #include "chrome/browser/browser_list.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 SkBitmap* zero_icon) 60 SkBitmap* zero_icon)
61 : previous_percent_(-1), 61 : previous_percent_(-1),
62 current_percent_(-1), 62 current_percent_(-1),
63 increase_icon_(increase_icon), 63 increase_icon_(increase_icon),
64 decrease_icon_(decrease_icon), 64 decrease_icon_(decrease_icon),
65 zero_icon_(zero_icon), 65 zero_icon_(zero_icon),
66 bubble_(NULL), 66 bubble_(NULL),
67 view_(NULL), 67 view_(NULL),
68 animation_(this) { 68 animation_(this) {
69 animation_.SetSlideDuration(kAnimationDurationMs); 69 animation_.SetSlideDuration(kAnimationDurationMs);
70 animation_.SetTweenType(Tween::LINEAR); 70 animation_.SetTweenType(ui::Tween::LINEAR);
71 } 71 }
72 72
73 void SettingLevelBubble::ShowBubble(int percent) { 73 void SettingLevelBubble::ShowBubble(int percent) {
74 if (percent < 0) 74 if (percent < 0)
75 percent = 0; 75 percent = 0;
76 if (percent > 100) 76 if (percent > 100)
77 percent = 100; 77 percent = 100;
78 if (previous_percent_ == -1) 78 if (previous_percent_ == -1)
79 previous_percent_ = percent; 79 previous_percent_ = percent;
80 current_percent_ = percent; 80 current_percent_ = percent;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 void SettingLevelBubble::InfoBubbleClosing(InfoBubble* info_bubble, bool) { 131 void SettingLevelBubble::InfoBubbleClosing(InfoBubble* info_bubble, bool) {
132 DCHECK(info_bubble == bubble_); 132 DCHECK(info_bubble == bubble_);
133 timeout_timer_.Stop(); 133 timeout_timer_.Stop();
134 animation_.Stop(); 134 animation_.Stop();
135 bubble_ = NULL; 135 bubble_ = NULL;
136 view_ = NULL; 136 view_ = NULL;
137 } 137 }
138 138
139 void SettingLevelBubble::AnimationEnded(const Animation* animation) { 139 void SettingLevelBubble::AnimationEnded(const ui::Animation* animation) {
140 previous_percent_ = current_percent_; 140 previous_percent_ = current_percent_;
141 } 141 }
142 142
143 void SettingLevelBubble::AnimationProgressed(const Animation* animation) { 143 void SettingLevelBubble::AnimationProgressed(const ui::Animation* animation) {
144 if (view_) { 144 if (view_) {
145 view_->Update( 145 view_->Update(
146 Tween::ValueBetween(animation->GetCurrentValue(), 146 ui::Tween::ValueBetween(animation->GetCurrentValue(),
147 previous_percent_, 147 previous_percent_,
148 current_percent_)); 148 current_percent_));
149 } 149 }
150 } 150 }
151 151
152 } // namespace chromeos 152 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble.h ('k') | chrome/browser/chromeos/status/network_dropdown_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698