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

Unified Diff: ui/aura_shell/workspace/workspace_manager.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_manager.h ('k') | ui/aura_shell/workspace/workspace_manager_unittest.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.cc
diff --git a/ui/aura_shell/workspace/workspace_manager.cc b/ui/aura_shell/workspace/workspace_manager.cc
index c8904ea695d310abf48015158891112a05e3634b..aa777a4d23e350800c8c460c3d6560f02d81379b 100644
--- a/ui/aura_shell/workspace/workspace_manager.cc
+++ b/ui/aura_shell/workspace/workspace_manager.cc
@@ -1,22 +1,22 @@
// 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_manager.h"
#include <algorithm>
#include "base/auto_reset.h"
+#include "base/logging.h"
+#include "base/stl_util.h"
#include "ui/aura/desktop.h"
#include "ui/aura/screen_aura.h"
#include "ui/aura/window.h"
#include "ui/aura_shell/workspace/workspace.h"
-#include "ui/aura_shell/workspace/workspace_manager.h"
-#include "ui/gfx/screen.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
+#include "ui/gfx/screen.h"
#include "ui/gfx/transform.h"
-#include "base/logging.h"
-#include "base/stl_util.h"
namespace {
@@ -30,6 +30,7 @@ const float kMinOverviewScale = 0.3f;
}
namespace aura_shell {
+namespace internal {
////////////////////////////////////////////////////////////////////////////////
// WindowManager, public:
@@ -40,11 +41,9 @@ WorkspaceManager::WorkspaceManager(aura::Window* viewport)
workspace_size_(
gfx::Screen::GetMonitorAreaNearestWindow(viewport_).size()),
is_overview_(false) {
- aura::Desktop::GetInstance()->AddObserver(this);
}
WorkspaceManager::~WorkspaceManager() {
- aura::Desktop::GetInstance()->RemoveObserver(this);
std::vector<Workspace*> copy_to_delete(workspaces_);
STLDeleteElements(&copy_to_delete);
}
@@ -165,21 +164,13 @@ void WorkspaceManager::RotateWindows(aura::Window* source,
}
}
-////////////////////////////////////////////////////////////////////////////////
-// WorkspaceManager, Overridden from aura::DesktopObserver:
-
-void WorkspaceManager::OnDesktopResized(const gfx::Size& new_size) {
- workspace_size_ =
- gfx::Screen::GetMonitorAreaNearestWindow(viewport_).size();
+void WorkspaceManager::SetWorkspaceSize(const gfx::Size& workspace_size) {
+ if (workspace_size == workspace_size_)
+ return;
+ workspace_size_ = workspace_size;
LayoutWorkspaces();
}
-void WorkspaceManager::OnActiveWindowChanged(aura::Window* active) {
- Workspace* workspace = FindBy(active);
- if (workspace)
- SetActiveWorkspace(workspace);
-}
-
////////////////////////////////////////////////////////////////////////////////
// WorkspaceManager, private:
@@ -203,14 +194,10 @@ void WorkspaceManager::RemoveWorkspace(Workspace* workspace) {
}
void WorkspaceManager::SetActiveWorkspace(Workspace* workspace) {
- DCHECK(std::find(workspaces_.begin(),
- workspaces_.end(),
- workspace)
- != workspaces_.end());
+ DCHECK(std::find(workspaces_.begin(), workspaces_.end(),
+ workspace) != workspaces_.end());
active_workspace_ = workspace;
- DCHECK(!workspaces_.empty());
-
is_overview_ = false;
UpdateViewport();
}
@@ -253,4 +240,5 @@ void WorkspaceManager::UpdateViewport() {
}
}
+} // namespace internal
} // namespace aura_shell
« no previous file with comments | « ui/aura_shell/workspace/workspace_manager.h ('k') | ui/aura_shell/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698