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

Unified Diff: chrome/browser/chromeos/volume_bubble.h

Issue 2790012: Volume bubble added for ChromeOS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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: chrome/browser/chromeos/volume_bubble.h
===================================================================
--- chrome/browser/chromeos/volume_bubble.h (revision 0)
+++ chrome/browser/chromeos/volume_bubble.h (revision 0)
@@ -0,0 +1,61 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_VOLUME_BUBBLE_H_
+#define CHROME_BROWSER_CHROMEOS_VOLUME_BUBBLE_H_
+
+#include "app/active_window_watcher_x.h"
+#include "app/slide_animation.h"
+#include "base/singleton.h"
+#include "chrome/browser/views/info_bubble.h"
+
+namespace chromeos {
+
+class VolumeBubbleView;
+
+// Singleton class controlling volume bubble.
+class VolumeBubble : public InfoBubbleDelegate,
+ public AnimationDelegate {
+ public:
+ static VolumeBubble* instance() {
+ return Singleton<VolumeBubble>::get();
+ }
+
+ void ShowVolumeBubble(int percent);
+
+ private:
+ friend struct DefaultSingletonTraits<VolumeBubble>;
+
+ VolumeBubble();
+ void OnTimeout();
+
+ // Overridden from InfoBubbleDelegate.
+ virtual void InfoBubbleClosing(InfoBubble* info_bubble,
+ bool closed_by_escape);
+ virtual bool CloseOnEscape() { return true; }
+ virtual bool FadeInOnShow() { return false; }
+
+ // Overridden from AnimationDelegate.
+ virtual void AnimationEnded(const Animation* animation);
+ virtual void AnimationProgressed(const Animation* animation);
+
+ // Previous and current volume percentages, -1 if not yet shown.
+ int previous_percent_;
+ int current_percent_;
+
+ // Currently shown bubble or NULL.
+ InfoBubble* bubble_;
+
+ // Its contents view, owned by InfoBubble.
+ VolumeBubbleView* view_;
+
+ SlideAnimation animation_;
+ base::OneShotTimer<VolumeBubble> timeout_timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(VolumeBubble);
+};
+
+} // namespace
+
+#endif // CHROME_BROWSER_CHROMEOS_VOLUME_BUBBLE_H_
Property changes on: chrome/browser/chromeos/volume_bubble.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698