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

Unified Diff: ash/common/shelf/wm_shelf.h

Issue 2272793005: ash: Move alignment and autohide behavior from Shelf to WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 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
« no previous file with comments | « ash/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/wm_shelf.h
diff --git a/ash/common/shelf/wm_shelf.h b/ash/common/shelf/wm_shelf.h
index 172a529c74cf431db12be0341996e2f57055dde9..33f4450941b68fdb525cd4cee2329bfb93771373 100644
--- a/ash/common/shelf/wm_shelf.h
+++ b/ash/common/shelf/wm_shelf.h
@@ -5,6 +5,8 @@
#ifndef ASH_COMMON_SHELF_WM_SHELF_H_
#define ASH_COMMON_SHELF_WM_SHELF_H_
+#include <memory>
+
#include "ash/ash_export.h"
#include "ash/common/shelf/shelf_layout_manager_observer.h"
#include "ash/common/shelf/shelf_types.h"
@@ -24,12 +26,14 @@ class Shelf;
class ShelfLayoutManager;
class ShelfLockingManager;
class ShelfView;
+class ShelfWidget;
class StatusAreaWidget;
class WmDimmerView;
class WmShelfObserver;
class WmWindow;
-// Used for accessing global state.
+// Controller for the shelf state. Exists for the lifetime of each root window
+// controller. Note that the shelf widget may not be created until after login.
class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
public:
void SetShelf(Shelf* shelf);
@@ -44,7 +48,9 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
// Returns the window showing the shelf.
WmWindow* GetWindow();
- ShelfAlignment GetAlignment() const;
+ ShelfAlignment alignment() const { return alignment_; }
+ // TODO(jamescook): Replace with alignment().
+ ShelfAlignment GetAlignment() const { return alignment_; }
void SetAlignment(ShelfAlignment alignment);
// Returns true if the shelf alignment is horizontal (i.e. at the bottom).
@@ -56,7 +62,9 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
// Returns |horizontal| is shelf is horizontal, otherwise |vertical|.
int PrimaryAxisValue(int horizontal, int vertical) const;
- ShelfAutoHideBehavior GetAutoHideBehavior() const;
+ ShelfAutoHideBehavior auto_hide_behavior() const {
+ return auto_hide_behavior_;
+ }
void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
ShelfAutoHideState GetAutoHideState() const;
@@ -112,6 +120,7 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
void SetVirtualKeyboardBoundsForTesting(const gfx::Rect& bounds);
ShelfLockingManager* GetShelfLockingManagerForTesting();
ShelfView* GetShelfViewForTesting();
+ ShelfWidget* GetShelfWidgetForTesting();
protected:
WmShelf();
@@ -133,6 +142,13 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
// ShelfWidget and lifetimes are managed by the container windows themselves.
ShelfLayoutManager* shelf_layout_manager_ = nullptr;
+ ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM_LOCKED;
+
+ // Sets shelf alignment to bottom during login and screen lock.
+ std::unique_ptr<ShelfLockingManager> shelf_locking_manager_;
+
+ ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
+
base::ObserverList<WmShelfObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(WmShelf);
« no previous file with comments | « ash/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698