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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/aura_shell/workspace/workspace_controller.h"
6
7 #include "ui/aura/desktop.h"
8 #include "ui/aura/window.h"
9 #include "ui/aura_shell/default_container_layout_manager.h"
10 #include "ui/aura_shell/workspace/workspace.h"
11 #include "ui/aura_shell/workspace/workspace_manager.h"
12
13 namespace aura_shell {
14 namespace internal {
15
16 WorkspaceController::WorkspaceController(aura::Window* window)
17 : workspace_manager_(new WorkspaceManager(window)),
18 layout_manager_(new internal::DefaultContainerLayoutManager(
19 window, workspace_manager_.get())) {
20 window->SetLayoutManager(layout_manager_);
21 aura::Desktop::GetInstance()->AddObserver(this);
22 }
23
24 WorkspaceController::~WorkspaceController() {
25 aura::Desktop::GetInstance()->RemoveObserver(this);
26 }
27
28 void WorkspaceController::ToggleOverview() {
29 workspace_manager_->SetOverview(!workspace_manager_->is_overview());
30 }
31
32 void WorkspaceController::OnDesktopResized(const gfx::Size& new_size) {
33 layout_manager_->set_ignore_calculate_bounds(true);
34 workspace_manager_->SetWorkspaceSize(new_size);
35 layout_manager_->set_ignore_calculate_bounds(false);
36 }
37
38 void WorkspaceController::OnActiveWindowChanged(aura::Window* active) {
39 // FindBy handles NULL.
40 Workspace* workspace = workspace_manager_->FindBy(active);
41 if (workspace)
42 workspace->Activate();
43 }
44
45 } // namespace internal
46 } // namespace aura_shell
OLDNEW
« 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