Chromium Code Reviews| Index: chrome/browser/ui/panels/auto_hide_bottom_bar.h |
| =================================================================== |
| --- chrome/browser/ui/panels/auto_hide_bottom_bar.h (revision 0) |
| +++ chrome/browser/ui/panels/auto_hide_bottom_bar.h (revision 0) |
| @@ -0,0 +1,59 @@ |
| +// Copyright (c) 2011 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_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
| +#define CHROME_BROWSER_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
| +#pragma once |
| + |
| +#include "base/memory/ref_counted.h" |
| + |
| +namespace gfx { |
| +class Rect; |
| +} |
| + |
| +// Encapsulates the logic to deal with always-on-top system/app bar that is |
| +// located at the bottom of the screen and set to auto-hide, like Windows |
|
jennb
2011/08/23 20:28:34
Just thinking ahead: this one handles bottom of s
jianli
2011/08/26 00:18:16
Refactored to handle all other edges.
|
| +// taskbar or MacOSX dock. |
| +// Note that the ref count is needed by using PostTask in the implementation of |
| +// MockAutoHideBottomBar that derives from AutoHideBottomBar. |
| +class AutoHideBottomBar : public base::RefCountedThreadSafe<AutoHideBottomBar> { |
| + public: |
| + enum Visibility { |
| + VISIBLE, |
| + ANIMATING, |
| + HIDDEN |
| + }; |
| + |
| + // Observer can listen to various events regarding the bottom bar changes. |
| + class Observer { |
| + public: |
| + virtual void OnAutoHideBottomBarVisibilityChanged( |
| + Visibility visibility) = 0; |
| + virtual void OnAutoHideBottomBarHeightChanged(int height) = 0; |
| + }; |
| + |
| + static AutoHideBottomBar* Create(Observer* observer); |
| + |
| + virtual ~AutoHideBottomBar() { } |
| + |
| + // This should be called each time when the work area is changed. We only |
| + // care about the bottom bar that sits on the screen that hosts the specified |
| + // work area. |
| + virtual void UpdateWorkArea(const gfx::Rect& work_area) = 0; |
| + |
| + // Returns true if the auto-hide bottom bar is enabled. |
| + virtual bool IsEnabled() = 0; |
|
jennb
2011/08/23 20:28:34
After reading more, I realize this value does doub
jianli
2011/08/26 00:18:16
Now it takes an alignment parameter.
|
| + |
| + // Returns the fixed height of the bottom bar. Note that the height remains |
| + // unchanged no matter whether the bottom bar is brought up or down. |
| + |
|
jennb
2011/08/23 20:28:34
Extra blank line?
jianli
2011/08/26 00:18:16
Not needed. Removed.
|
| + // Returns the height of bottom bar that corresponds to Visibility VISIBLE. |
| + // This value does not depend on current bar's Visibility. The visible height |
| + // of the bar when it's HIDDEN is usually between 0 and a few pixels. |
| + virtual int GetHeight() = 0; |
| + |
| + virtual Visibility GetVisibility() = 0; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_PANELS_AUTO_HIDE_BOTTOM_BAR_H_ |
| Property changes on: chrome\browser\ui\panels\auto_hide_bottom_bar.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |