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

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

Issue 8381015: Add workspace to desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " 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
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..473dcb7ee453614e62346eb5b1d619315a13fb76 100644
--- a/ui/aura_shell/workspace/workspace_manager.h
+++ b/ui/aura_shell/workspace/workspace_manager.h
@@ -8,22 +8,35 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/compiler_specific.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 : aura::DesktopObserver {
sky 2011/10/25 20:58:05 public aura::DesktopObserver
oshima 2011/10/25 23:37:23 Done.
public:
- explicit WorkspaceManager();
+ explicit WorkspaceManager(aura::Window* viewport);
virtual ~WorkspaceManager();
+ void set_work_area_insets(const gfx::Insets& insets) {
+ work_area_insets_ = insets;
sky 2011/10/25 20:58:05 Caching the insets here and in screen makes it eas
oshima 2011/10/25 23:37:23 Good point. Done.
+ }
+
// Create new workspace. Workspace objects are managed by
// this WorkspaceManager. Deleting workspace will automatically
// remove the workspace from the workspace_manager.
@@ -36,14 +49,18 @@ class AURA_SHELL_EXPORT WorkspaceManager {
Workspace* FindBy(aura::Window* window) const;
// Sets the bounds of all workspaces.
- void Layout();
+ void LayoutWorkspaces();
+
+ // Returns
sky 2011/10/25 20:58:05 Document this.
oshima 2011/10/25 23:37:23 Done.
+ 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;
@@ -54,12 +71,26 @@ class AURA_SHELL_EXPORT WorkspaceManager {
// Sets the active workspace.
void SetActiveWorkspace(Workspace* workspace);
- gfx::Size workspace_size_;
+ // Returns the work area for given |workspace_bounds| by appliing
+ // the |work_area_insets_|.
sky 2011/10/25 20:58:05 Returns the bounds of the work area given the work
oshima 2011/10/25 23:37:23 Done.
+ gfx::Rect GetWorkAreaBounds(const gfx::Rect& workspace_bounds);
+
+ // Update viewport size and move to active workspace.
+ void UpdateViewport();
+
+ aura::Window* viewport_;
Workspace* active_workspace_;
std::vector<Workspace*> workspaces_;
+ gfx::Insets work_area_insets_;
+
+ gfx::Size workspace_size_;
sky 2011/10/25 20:58:05 Document this.
+
+ // True if the workspace manager is in overview mode.
+ bool is_overview_;
+
DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
};

Powered by Google App Engine
This is Rietveld 408576698