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

Unified Diff: ui/aura_shell/workspace/workspace_controller.cc

Issue 8400067: Fixes bug where windows weren't being moved and resized if the desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks 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_controller.cc
diff --git a/ui/aura_shell/workspace/workspace_controller.cc b/ui/aura_shell/workspace/workspace_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..acb6e866b768cf28dadd8fde97cd72b49c9367e8
--- /dev/null
+++ b/ui/aura_shell/workspace/workspace_controller.cc
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 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.
+
+#include "ui/aura_shell/workspace/workspace_controller.h"
+
+#include "ui/aura/desktop.h"
+#include "ui/aura/window.h"
+#include "ui/aura_shell/default_container_layout_manager.h"
+#include "ui/aura_shell/workspace/workspace.h"
+#include "ui/aura_shell/workspace/workspace_manager.h"
+
+namespace aura_shell {
+namespace internal {
+
+WorkspaceController::WorkspaceController(aura::Window* window)
+ : workspace_manager_(new WorkspaceManager(window)),
+ layout_manager_(new internal::DefaultContainerLayoutManager(
+ window, workspace_manager_.get())) {
+ window->SetLayoutManager(layout_manager_);
+ aura::Desktop::GetInstance()->AddObserver(this);
+}
+
+WorkspaceController::~WorkspaceController() {
+ aura::Desktop::GetInstance()->RemoveObserver(this);
+}
+
+void WorkspaceController::ToggleOverview() {
+ workspace_manager_->SetOverview(!workspace_manager_->is_overview());
+}
+
+void WorkspaceController::OnDesktopResized(const gfx::Size& new_size) {
+ layout_manager_->set_ignore_calculate_bounds(true);
+ workspace_manager_->SetWorkspaceSize(new_size);
+ layout_manager_->set_ignore_calculate_bounds(false);
+}
+
+void WorkspaceController::OnActiveWindowChanged(aura::Window* active) {
+ // FindBy handles NULL.
+ Workspace* workspace = workspace_manager_->FindBy(active);
+ if (workspace)
+ workspace_manager_->SetActiveWorkspace(workspace);
oshima 2011/10/28 18:38:23 workspace->Activate();
+}
+
+} // namespace internal
+} // namespace aura_shell

Powered by Google App Engine
This is Rietveld 408576698