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

Unified Diff: ui/aura_shell/workspace/workspace.h

Issue 8391035: Drag and rotate windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 9 years, 2 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 | « ui/aura_shell/default_container_layout_manager.cc ('k') | ui/aura_shell/workspace/workspace.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d04060edd6db5165201c8b56e6f954c94e4aa9fa 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(); }
@@ -49,23 +55,48 @@ class AURA_SHELL_EXPORT Workspace {
// failed.
bool AddWindowAfter(aura::Window* window, aura::Window* after);
- // Removes the |window| from this workspace.
+ // Removes |window| from this workspace.
void RemoveWindow(aura::Window* window);
- // Return true if this workspace has the |window|.
+ // Return true if this workspace has |window|.
bool Contains(aura::Window* window) const;
+ // Returns a window to rotate to based on |position|.
+ 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|. If |direction| is |SHIFT_TO_RIGHT|, |insert| is
+ // inserted at the position of |target| or at the beginning if
+ // |target| is NULL. If |direction| is |SHIFT_TO_LEFT|, |insert| is
+ // inserted after the position of |target|, or at the end if
+ // |target| is NULL. 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,
+ aura::Window* target,
+ 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 |ignore| if it's
+ // given. It still uses |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.
+ // Returns the index in layout order of |window| in this workspace.
int GetIndexOf(aura::Window* window) const;
// Returns true if the given |window| can be added to this workspace.
@@ -77,6 +108,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 have.
+ // 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_;
« no previous file with comments | « ui/aura_shell/default_container_layout_manager.cc ('k') | ui/aura_shell/workspace/workspace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698