| Index: ui/aura_shell/workspace/workspace_manager.h
|
| diff --git a/ui/aura_shell/workspace/workspace_manager.h b/ui/aura_shell/workspace/workspace_manager.h
|
| index 48f9d2d4dd0303108f8a8391223c2b754bd0d5c2..925fea24925d445180e7eb5e2fb4385bb8f81b26 100644
|
| --- a/ui/aura_shell/workspace/workspace_manager.h
|
| +++ b/ui/aura_shell/workspace/workspace_manager.h
|
| @@ -8,20 +8,29 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "base/gtest_prod_util.h"
|
| +#include "ui/aura/desktop_observer.h"
|
| #include "ui/aura_shell/aura_shell_export.h"
|
| +#include "ui/gfx/insets.h"
|
| #include "ui/gfx/size.h"
|
|
|
| namespace aura {
|
| class Window;
|
| }
|
|
|
| +namespace gfx {
|
| +class Point;
|
| +class Rect;
|
| +}
|
| +
|
| namespace aura_shell {
|
| class Workspace;
|
|
|
| // WorkspaceManager manages multiple workspaces in the desktop.
|
| -class AURA_SHELL_EXPORT WorkspaceManager {
|
| +class AURA_SHELL_EXPORT WorkspaceManager : public aura::DesktopObserver {
|
| public:
|
| - explicit WorkspaceManager();
|
| + explicit WorkspaceManager(aura::Window* viewport);
|
| virtual ~WorkspaceManager();
|
|
|
| // Create new workspace. Workspace objects are managed by
|
| @@ -36,17 +45,23 @@ class AURA_SHELL_EXPORT WorkspaceManager {
|
| Workspace* FindBy(aura::Window* window) const;
|
|
|
| // Sets the bounds of all workspaces.
|
| - void Layout();
|
| + void LayoutWorkspaces();
|
| +
|
| + // Returns the bounds in which a window can be moved/resized.
|
| + gfx::Rect GetDragAreaBounds();
|
|
|
| - // Returns the total width of all workspaces.
|
| - int GetTotalWidth() const;
|
| + // Turn on/off overview mode.
|
| + void SetOverview(bool overview);
|
| + bool is_overview() const { return is_overview_; }
|
|
|
| - // Sets/gets the size of the workspace.
|
| - void set_workspace_size(const gfx::Size& size) { workspace_size_ = size; }
|
| - const gfx::Size& workspace_size() const { return workspace_size_; }
|
| + // Overridden from aura::DesktopObserver:
|
| + virtual void OnDesktopResized(const gfx::Size& new_size) OVERRIDE;
|
| + virtual void OnActiveWindowChanged(aura::Window* active) OVERRIDE;
|
|
|
| private:
|
| friend class Workspace;
|
| + FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, Overview);
|
| + FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, LayoutWorkspaces);
|
|
|
| void AddWorkspace(Workspace* workspace);
|
| void RemoveWorkspace(Workspace* workspace);
|
| @@ -54,12 +69,25 @@ class AURA_SHELL_EXPORT WorkspaceManager {
|
| // Sets the active workspace.
|
| void SetActiveWorkspace(Workspace* workspace);
|
|
|
| - gfx::Size workspace_size_;
|
| + // Returns the bounds of the work are given |workspace_bounds|.
|
| + gfx::Rect GetWorkAreaBounds(const gfx::Rect& workspace_bounds);
|
| +
|
| + // Update viewport size and move to the active workspace.
|
| + void UpdateViewport();
|
| +
|
| + aura::Window* viewport_;
|
|
|
| Workspace* active_workspace_;
|
|
|
| std::vector<Workspace*> workspaces_;
|
|
|
| + // The size of a single workspace. This is generally the same as the size of
|
| + // monitor.
|
| + gfx::Size workspace_size_;
|
| +
|
| + // True if the workspace manager is in overview mode.
|
| + bool is_overview_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
|
| };
|
|
|
|
|