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,55 @@ |
| +// 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 |
| +// taskbar or MacOSX dock. |
| +class AutoHideBottomBar : public base::RefCountedThreadSafe<AutoHideBottomBar> { |
|
Dmitry Titov
2011/08/22 22:35:53
why this class is refcounted? It seems the singlet
jianli
2011/08/22 23:28:10
The test also keep a ref count to the mock because
|
| + public: |
| + enum Visibility { |
|
Dmitry Titov
2011/08/22 22:35:53
What do you think about this: Do we also need AUTO
jianli
2011/08/22 23:28:10
I think this state is not needed because this clas
|
| + VISIBLE, |
| + ANIMATING, |
| + HIDDEN |
| + }; |
| + |
| + // Observer can listen to various events regarding the bottom bar changes. |
| + // StartMonitoring should be called first if you want observer to receive |
| + // the notifications. |
| + 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 exists. |
| + virtual bool Exists() = 0; |
|
Dmitry Titov
2011/08/22 22:35:53
See comment above about AUTOHIDE_DISABLED. If we h
jianli
2011/08/22 23:28:10
See my reply above.
|
| + |
| + // Returns the fixed height of the bottom bar. Note that the height remains |
|
Dmitry Titov
2011/08/22 22:35:53
Suggestion on comment (not sure it's clearer thoug
jianli
2011/08/22 23:28:10
Done.
|
| + // unchanged no matter whether the bottom bar is brought up or down. |
| + 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 |