Index: ui/aura_shell/workspace/workspace.h |
diff --git a/ui/aura_shell/workspace/workspace.h b/ui/aura_shell/workspace/workspace.h |
index 136c88bc24ee9dfef4a62e3ef880edaa081e94cf..4f0f07ff84f2787af77ad65cdfc4c337011be2e7 100644 |
--- a/ui/aura_shell/workspace/workspace.h |
+++ b/ui/aura_shell/workspace/workspace.h |
@@ -32,6 +32,12 @@ class AURA_SHELL_EXPORT Workspace { |
explicit Workspace(WorkspaceManager* manager); |
virtual ~Workspace(); |
+ // Specifies the direction to shift windows in |ShiftWindows()|. |
+ enum ShiftDirection { |
+ SHIFT_TO_RIGHT, |
+ SHIFT_TO_LEFT |
+ }; |
+ |
// Returns true if this workspace has no windows. |
bool is_empty() const { return windows_.empty(); } |
@@ -55,15 +61,37 @@ class AURA_SHELL_EXPORT Workspace { |
// Return true if this workspace has the |window|. |
bool Contains(aura::Window* window) const; |
+ // Returns a window to rotate to based on the |position|. |
sky
2011/10/27 19:46:41
remove 'the'
oshima
2011/10/27 20:25:43
Done.
|
+ aura::Window* FindRotateWindowForLocation(const gfx::Point& position); |
+ |
+ // Rotates the windows by removing |source| and inserting it to the |
+ // position that |target| was in. It re-layouts windows except for |source|. |
+ void RotateWindows(aura::Window* source, aura::Window* target); |
+ |
+ // Shift the windows in the workspace by inserting |window| until |
+ // it reaches |until|. |insert| is inserted at the beginning if |
+ // the |direction| is |SHIFT_TO_RIGHT|, or at the end if the |direction| |
+ // is |SHIFT_TO_LEFT|. It returns the window that is overflowed by shifting, |
+ // or NULL if shifting stopped at |until|. |
+ aura::Window* ShiftWindows(aura::Window* insert, |
+ aura::Window* until, |
+ ShiftDirection direction); |
+ |
// Activates this workspace. |
void Activate(); |
- // Layout windows. Moving animation is applied to all windows except |
- // for the window specified by |no_animation|. |
- void Layout(aura::Window* no_animation); |
+ // Layout windows. The workspace doesn't set bounds on the |ignore| if it's |
sky
2011/10/27 19:46:41
'the ignore' -> 'ignore'
same with next line
oshima
2011/10/27 20:25:43
removed all "the" before ||
|
+ // given. It still uses the |ignore| window's bounds to calculate |
+ // bounds for other windows. Moving animation is applied to all |
+ // windows except for the window specified by |no_animation| and |ignore|. |
+ void Layout(aura::Window* ignore, aura::Window* no_animation); |
private: |
FRIEND_TEST_ALL_PREFIXES(WorkspaceTest, WorkspaceBasic); |
+ FRIEND_TEST_ALL_PREFIXES(WorkspaceTest, RotateWindows); |
+ FRIEND_TEST_ALL_PREFIXES(WorkspaceTest, ShiftWindowsSingle); |
+ FRIEND_TEST_ALL_PREFIXES(WorkspaceTest, ShiftWindowsMultiple); |
+ FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, RotateWindows); |
// Returns the index in layout order of the |window| in this workspace. |
int GetIndexOf(aura::Window* window) const; |
@@ -77,6 +105,14 @@ class AURA_SHELL_EXPORT Workspace { |
const gfx::Point& origin, |
bool animate); |
+ // Returns the sum of all window's width. |
+ int GetTotalWindowsWidth() const; |
+ |
+ // Test only: Changes how may windows workspace can haven. |
sky
2011/10/27 19:46:41
haven -> have
oshima
2011/10/27 20:25:43
Done.
|
+ // Returns the current value so that it can be reverted back to |
+ // original value. |
+ static size_t SetMaxWindowsCount(size_t max); |
+ |
WorkspaceManager* workspace_manager_; |
gfx::Rect bounds_; |