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

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

Issue 8430024: Add WorkspaceObserver to observe changes in workspace state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comments Created 9 years, 1 month 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/workspace/workspace_controller.cc ('k') | ui/aura_shell/workspace/workspace_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28cbab51574e8cd301485190653290e0c13a0943..4bdb17bbdeb95bd060edeeff7367d3d42f53915e 100644
--- a/ui/aura_shell/workspace/workspace_manager.h
+++ b/ui/aura_shell/workspace/workspace_manager.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/observer_list.h"
#include "ui/aura_shell/aura_shell_export.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/size.h"
@@ -25,6 +26,7 @@ class Rect;
namespace aura_shell {
namespace internal {
class Workspace;
+class WorkspaceObserver;
// WorkspaceManager manages multiple workspaces in the desktop.
class AURA_SHELL_EXPORT WorkspaceManager {
@@ -32,6 +34,10 @@ class AURA_SHELL_EXPORT WorkspaceManager {
explicit WorkspaceManager(aura::Window* viewport);
virtual ~WorkspaceManager();
+ // Returns the viewport window this WorkspaceManager layouts
+ // workspaces on.
+ aura::Window* viewport() { return viewport_; }
+
// Create new workspace. Workspace objects are managed by
// this WorkspaceManager. Deleting workspace will automatically
// remove the workspace from the workspace_manager.
@@ -62,6 +68,19 @@ class AURA_SHELL_EXPORT WorkspaceManager {
// Sets the size of a single workspace (all workspaces have the same size).
void SetWorkspaceSize(const gfx::Size& workspace_size);
+ // Adds/Removes workspace observer.
+ void AddObserver(WorkspaceObserver* observer);
+ void RemoveObserver(WorkspaceObserver* observer);
+
+ // Returns true if this workspace manager is laying out windows.
+ // When true, LayoutManager must give windows their requested bounds.
+ bool layout_in_progress() const { return layout_in_progress_; }
+
+ // Sets the |layout_in_progress_| flag.
+ void set_layout_in_progress(bool layout_in_progress) {
+ layout_in_progress_ = layout_in_progress;
+ }
+
private:
friend class Workspace;
@@ -93,6 +112,11 @@ class AURA_SHELL_EXPORT WorkspaceManager {
// True if the workspace manager is in overview mode.
bool is_overview_;
+ // True if this layout manager is laying out windows.
+ bool layout_in_progress_;
+
+ ObserverList<WorkspaceObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
};
« no previous file with comments | « ui/aura_shell/workspace/workspace_controller.cc ('k') | ui/aura_shell/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698