OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/ref_counted.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Rect; |
| 13 } |
| 14 |
| 15 // Encapsulates the logic to deal with always-on-top system/app bar that is |
| 16 // located at the bottom of the screen and set to auto-hide, like Windows |
| 17 // taskbar or MacOSX dock. |
| 18 class AutoHideBottomBar : public base::RefCountedThreadSafe<AutoHideBottomBar> { |
| 19 public: |
| 20 enum Visibility { |
| 21 VISIBLE, |
| 22 ANIMATING, |
| 23 HIDDEN |
| 24 }; |
| 25 |
| 26 // Observer can listen to various events regarding the bottom bar changes. |
| 27 // StartMonitoring should be called first if you want observer to receive |
| 28 // the notifications. |
| 29 class Observer { |
| 30 public: |
| 31 virtual void OnAutoHideBottomBarVisibilityChanged( |
| 32 Visibility visibility) = 0; |
| 33 virtual void OnAutoHideBottomBarHeightChanged(int height) = 0; |
| 34 }; |
| 35 |
| 36 static AutoHideBottomBar* Create(Observer* observer); |
| 37 |
| 38 virtual ~AutoHideBottomBar() { } |
| 39 |
| 40 // This should be called each time when the work area is changed. We only |
| 41 // care about the bottom bar that sits on the screen that hosts the specified |
| 42 // work area. |
| 43 virtual void UpdateWorkArea(const gfx::Rect& work_area) = 0; |
| 44 |
| 45 // Returns true if the auto-hide bottom bar exists. |
| 46 virtual bool Exists() = 0; |
| 47 |
| 48 // Returns the fixed height of the bottom bar. Note that the height remains |
| 49 // unchanged no matter whether the bottom bar is brought up or down. |
| 50 virtual int GetHeight() = 0; |
| 51 |
| 52 virtual Visibility GetVisibility() = 0; |
| 53 }; |
| 54 |
| 55 #endif // CHROME_BROWSER_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
OLD | NEW |