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

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: Merge and incorporate feedback 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
« no previous file with comments | « ui/aura_shell/workspace/workspace_controller.h ('k') | ui/aura_shell/workspace/workspace_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e17228b3aa4b21f1eabfca1fd54359acfbbc90cb
--- /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->Activate();
+}
+
+} // namespace internal
+} // namespace aura_shell
« no previous file with comments | « ui/aura_shell/workspace/workspace_controller.h ('k') | ui/aura_shell/workspace/workspace_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698