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

Unified Diff: views/bubble/bubble_delegate.cc

Issue 8319008: aura: brightness and volume bubble. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update comments Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: views/bubble/bubble_delegate.cc
diff --git a/views/bubble/bubble_delegate.cc b/views/bubble/bubble_delegate.cc
index b46e3536bf73feba52fed2035c22b8abb319c331..1fb7ebf56cf7e86b4e51e14fc1691d2ecc311a82 100644
--- a/views/bubble/bubble_delegate.cc
+++ b/views/bubble/bubble_delegate.cc
@@ -29,7 +29,8 @@ BubbleDelegateView::BubbleDelegateView(
close_on_esc_(true),
anchor_point_(anchor_point),
arrow_location_(arrow_location),
- color_(color) {
+ color_(color),
+ original_opacity_(255) {
AddAccelerator(Accelerator(ui::VKEY_ESCAPE, 0));
}
@@ -88,14 +89,21 @@ void BubbleDelegateView::StartFade(bool fade_in) {
fade_animation_->SetSlideDuration(kHideFadeDurationMS);
fade_animation_->Reset(fade_in ? 0.0 : 1.0);
if (fade_in) {
- GetWidget()->SetOpacity(0);
+ original_opacity_ = 0;
+ GetWidget()->SetOpacity(original_opacity_);
GetWidget()->Show();
fade_animation_->Show();
} else {
+ original_opacity_ = 255;
fade_animation_->Hide();
}
}
+void BubbleDelegateView::ResetFade() {
+ fade_animation_.reset();
+ GetWidget()->SetOpacity(original_opacity_);
+}
+
bool BubbleDelegateView::AcceleratorPressed(const Accelerator& accelerator) {
if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE)
return false;
« chrome/browser/chromeos/volume_bubble_browsertest.cc ('K') | « views/bubble/bubble_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698