| Index: ash/wm/shelf_layout_manager.h
|
| diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
|
| index 52873b13c35d73911c3b4b668077655f706779cc..bd8b306b4fea90712e803218f060b75564224d6a 100644
|
| --- a/ash/wm/shelf_layout_manager.h
|
| +++ b/ash/wm/shelf_layout_manager.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/gtest_prod_util.h"
|
| +#include "base/logging.h"
|
| #include "base/observer_list.h"
|
| #include "base/timer.h"
|
| #include "ui/aura/layout_manager.h"
|
| @@ -93,7 +94,7 @@ class ASH_EXPORT ShelfLayoutManager :
|
| // Sets the alignment. Returns true if the alignment is changed. Otherwise,
|
| // returns false.
|
| bool SetAlignment(ShelfAlignment alignment);
|
| - ShelfAlignment alignment() const { return alignment_; }
|
| + ShelfAlignment GetAlignment() const { return alignment_; }
|
|
|
| void set_workspace_controller(WorkspaceController* controller) {
|
| workspace_controller_ = controller;
|
| @@ -171,6 +172,36 @@ class ASH_EXPORT ShelfLayoutManager :
|
| virtual void OnWindowActivated(aura::Window* active,
|
| aura::Window* old_active) OVERRIDE;
|
|
|
| + // TODO(harrym|oshima): These templates will be moved to
|
| + // new Shelf class.
|
| + // A helper function that provides a shortcut for choosing
|
| + // values specific to a shelf alignment.
|
| + template<typename T>
|
| + T SelectValueForShelfAlignment(T bottom, T left, T right) const {
|
| + switch (alignment_) {
|
| + case SHELF_ALIGNMENT_BOTTOM:
|
| + return bottom;
|
| + case SHELF_ALIGNMENT_LEFT:
|
| + return left;
|
| + case SHELF_ALIGNMENT_RIGHT:
|
| + return right;
|
| + }
|
| + NOTREACHED();
|
| + return right;
|
| + }
|
| +
|
| + template<typename T>
|
| + T PrimaryAxisValue(T horizontal, T vertical) const {
|
| + return IsHorizontalAlignment() ? horizontal : vertical;
|
| + }
|
| +
|
| + // Is the shelf's alignment horizontal?
|
| + bool IsHorizontalAlignment() const;
|
| +
|
| + // Returns a ShelfLayoutManager on the display which has a launcher for
|
| + // given |window|. See RootWindowController::ForLauncher for more info.
|
| + static ShelfLayoutManager* ForLauncher(aura::Window* window);
|
| +
|
| private:
|
| class AutoHideEventFilter;
|
| class UpdateShelfObserver;
|
| @@ -248,10 +279,6 @@ class ASH_EXPORT ShelfLayoutManager :
|
|
|
| int GetWorkAreaSize(const State& state, int size) const;
|
|
|
| - int axis_position(int x, int y) const {
|
| - return alignment_ == SHELF_ALIGNMENT_BOTTOM ? y : x;
|
| - }
|
| -
|
| // The RootWindow is cached so that we don't invoke Shell::GetInstance() from
|
| // our destructor. We avoid that as at the time we're deleted Shell is being
|
| // deleted too.
|
|
|