summaryrefslogtreecommitdiffstats
path: root/ash/wm/shelf_layout_manager.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-25 22:53:59 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-25 22:53:59 +0000
commitc758fbfb081067de767084064c3e94067d922beb (patch)
tree6adbed42b929e6ce20dce0c4eb51f15e343e4dfa /ash/wm/shelf_layout_manager.h
parentbbcde910463b8d226b6f077fc4f0009f5c147406 (diff)
downloadchromium_src-c758fbfb081067de767084064c3e94067d922beb.zip
chromium_src-c758fbfb081067de767084064c3e94067d922beb.tar.gz
chromium_src-c758fbfb081067de767084064c3e94067d922beb.tar.bz2
Adds context menu so that shelf always auto-hides (except on lock
screen). This also cleans up code that was forcing shelf to be visible when lock screen up, and it removes the 'snap to grid' menu item on the background. BUG=119804 TEST=none R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/9854001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/shelf_layout_manager.h')
-rw-r--r--ash/wm/shelf_layout_manager.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
index 262657b..05e3e7a 100644
--- a/ash/wm/shelf_layout_manager.h
+++ b/ash/wm/shelf_layout_manager.h
@@ -22,6 +22,9 @@ class Widget;
namespace ash {
namespace internal {
+class ShelfLayoutManagerTest;
+class WorkspaceManager;
+
// ShelfLayoutManager is the layout manager responsible for the launcher and
// status widgets. The launcher is given the total available width and told the
// width of the status area. This allows the launcher to draw the background and
@@ -60,6 +63,14 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager {
explicit ShelfLayoutManager(views::Widget* status);
virtual ~ShelfLayoutManager();
+ // Sets whether the shelf always auto-hides. Default is false.
+ void SetAlwaysAutoHide(bool value);
+ bool always_auto_hide() const { return always_auto_hide_; }
+
+ void set_workspace_manager(WorkspaceManager* manager) {
+ workspace_manager_ = manager;
+ }
+
views::Widget* launcher_widget() {
return launcher_ ? launcher_->widget() : NULL;
}
@@ -84,20 +95,15 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager {
// widgets.
void LayoutShelf();
- // Sets the visibility of the shelf to |state|.
- void SetState(VisibilityState visibility_state);
- VisibilityState visibility_state() const { return state_.visibility_state; }
- AutoHideState auto_hide_state() const { return state_.auto_hide_state; }
-
- // Forces the visibility to |forced_visibility_state|. Any calls to SetState
- // are ignored after this until ClearForcedState is called.
- // TODO: clean this up!
- void SetForcedState(VisibilityState forced_visibility_state);
- void ClearForcedState();
+ // Updates the visibility state.
+ void UpdateVisibilityState();
// Invoked by the shelf/launcher when the auto-hide state may have changed.
void UpdateAutoHideState();
+ VisibilityState visibility_state() const { return state_.visibility_state; }
+ AutoHideState auto_hide_state() const { return state_.auto_hide_state; }
+
// Sets whether any windows overlap the shelf. If a window overlaps the shelf
// the shelf renders slightly differently.
void SetWindowOverlapsShelf(bool value);
@@ -113,6 +119,7 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager {
private:
class AutoHideEventFilter;
+ friend class ShelfLayoutManagerTest;
struct TargetBounds {
TargetBounds() : opacity(0.0f) {}
@@ -139,6 +146,9 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager {
AutoHideState auto_hide_state;
};
+ // Sets the visibility of the shelf to |state|.
+ void SetState(VisibilityState visibility_state);
+
// Stops any animations.
void StopAnimating();
@@ -163,21 +173,20 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager {
// again from SetChildBounds().
bool in_layout_;
+ // See description above setter.
+ bool always_auto_hide_;
+
// Current state.
State state_;
- // Variables to keep track of the visibility state when we need to force the
- // visibility to a particular value.
- VisibilityState forced_visibility_state_;
- VisibilityState normal_visibility_state_;
- bool is_visibility_state_forced_;
-
// Height of the shelf (max of launcher and status).
int shelf_height_;
Launcher* launcher_;
views::Widget* status_;
+ WorkspaceManager* workspace_manager_;
+
// Do any windows overlap the shelf? This is maintained by WorkspaceManager.
bool window_overlaps_shelf_;