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

Unified Diff: ash/wm/workspace/workspace2.h

Issue 10830365: Initial crack at new workspace behavior. Each workspace now has its (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « ash/wm/window_util.h ('k') | ash/wm/workspace/workspace2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace2.h
diff --git a/ash/wm/workspace/workspace2.h b/ash/wm/workspace/workspace2.h
new file mode 100644
index 0000000000000000000000000000000000000000..3045424762da71798961b2ceea2633ab85a28c5d
--- /dev/null
+++ b/ash/wm/workspace/workspace2.h
@@ -0,0 +1,74 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_WORKSPACE_WORKSPACE2_H_
+#define ASH_WM_WORKSPACE_WORKSPACE_H_
+
+#include <vector>
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+
+namespace aura {
+class Window;
+}
+
+namespace gfx {
+class Rect;
+}
+
+namespace ash {
+namespace internal {
+
+class WorkspaceEventFilter;
+class WorkspaceManager2;
+
+// Workspace is used to maintain either a single maximized windows (including
+// transients and other windows) or any number of windows (for the
+// desktop). Workspace is used by WorkspaceManager to manage a set of windows.
+class ASH_EXPORT Workspace2 {
+ public:
+ Workspace2(WorkspaceManager2* manager,
+ aura::Window* parent,
+ bool is_maximized);
+ ~Workspace2();
+
+ // Resets state. This should be used before destroying the Workspace.
+ aura::Window* ReleaseWindow();
+
+ bool is_maximized() const { return is_maximized_; }
+
+ aura::Window* window() { return window_; }
+
+ WorkspaceManager2* workspace_manager() { return workspace_manager_; }
+
+ void SetGridSize(int grid_size);
+
+ // Returns true if the Workspace should be moved to pending. This is true
+ // if there are no visible maximized windows.
+ bool ShouldMoveToPending() const;
+
+ // Returns the number of maximized windows (including minimized windows that
+ // would be maximized on restore). This does not consider visibility.
+ int GetNumMaximizedWindows() const;
+
+ private:
+ // Is this a workspace for maximized windows?
+ const bool is_maximized_;
+
+ WorkspaceManager2* workspace_manager_;
+
+ // Our Window, owned by |parent| passed to the constructor.
+ aura::Window* window_;
+
+ // Owned by |window_|.
+ WorkspaceEventFilter* event_filter_;
+
+ DISALLOW_COPY_AND_ASSIGN(Workspace2);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_WM_WORKSPACE_WORKSPACE2_H_
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/workspace/workspace2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698