Chromium Code Reviews| 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/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/chromeos/login/background_view.h" | 10 #include "chrome/browser/chromeos/login/background_view.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 animation_.Show(); | 129 animation_.Show(); |
| 130 timeout_timer_.Start(base::TimeDelta::FromSeconds(kBubbleShowTimeoutSec), | 130 timeout_timer_.Start(base::TimeDelta::FromSeconds(kBubbleShowTimeoutSec), |
| 131 this, &SettingLevelBubble::OnTimeout); | 131 this, &SettingLevelBubble::OnTimeout); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void SettingLevelBubble::HideBubble() { | 134 void SettingLevelBubble::HideBubble() { |
| 135 if (bubble_) | 135 if (bubble_) |
| 136 bubble_->Close(); | 136 bubble_->Close(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool SettingLevelBubble::IsShown() const { | |
| 140 return bubble_; | |
|
glotov
2011/07/05 11:10:27
Does bubble_->Close() zero bubble_ variable?
In ot
SeRya
2011/07/05 12:09:51
Yes, SettingLevelBubble::BubbleClosing makes it NU
| |
| 141 } | |
| 142 | |
| 139 void SettingLevelBubble::UpdateWithoutShowingBubble(int percent) { | 143 void SettingLevelBubble::UpdateWithoutShowingBubble(int percent) { |
| 140 percent = LimitPercent(percent); | 144 percent = LimitPercent(percent); |
| 141 | 145 |
| 142 previous_percent_ = | 146 previous_percent_ = |
| 143 animation_.is_animating() ? | 147 animation_.is_animating() ? |
| 144 animation_.GetCurrentValue() : | 148 animation_.GetCurrentValue() : |
| 145 current_percent_; | 149 current_percent_; |
| 146 if (previous_percent_ < 0) | 150 if (previous_percent_ < 0) |
| 147 previous_percent_ = percent; | 151 previous_percent_ = percent; |
| 148 current_percent_ = percent; | 152 current_percent_ = percent; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 void SettingLevelBubble::AnimationProgressed(const ui::Animation* animation) { | 184 void SettingLevelBubble::AnimationProgressed(const ui::Animation* animation) { |
| 181 if (view_) { | 185 if (view_) { |
| 182 view_->Update( | 186 view_->Update( |
| 183 ui::Tween::ValueBetween(animation->GetCurrentValue(), | 187 ui::Tween::ValueBetween(animation->GetCurrentValue(), |
| 184 previous_percent_, | 188 previous_percent_, |
| 185 current_percent_)); | 189 current_percent_)); |
| 186 } | 190 } |
| 187 } | 191 } |
| 188 | 192 |
| 189 } // namespace chromeos | 193 } // namespace chromeos |
| OLD | NEW |