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

Side by Side Diff: ui/aura_shell/default_container_layout_manager.cc

Issue 8414017: Activate the workspace that dragged window has landed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura_shell/default_container_layout_manager.h" 5 #include "ui/aura_shell/default_container_layout_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "ui/aura/desktop.h" 8 #include "ui/aura/desktop.h"
9 #include "ui/aura/event.h" 9 #include "ui/aura/event.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (rotate_target) 67 if (rotate_target)
68 workspace_manager_->RotateWindows(drag, rotate_target); 68 workspace_manager_->RotateWindows(drag, rotate_target);
69 } 69 }
70 70
71 void DefaultContainerLayoutManager::EndMove( 71 void DefaultContainerLayoutManager::EndMove(
72 aura::Window* drag, 72 aura::Window* drag,
73 aura::MouseEvent* evnet) { 73 aura::MouseEvent* evnet) {
74 // TODO(oshima): finish moving window between workspaces. 74 // TODO(oshima): finish moving window between workspaces.
75 AutoReset<bool> reset(&ignore_calculate_bounds_, true); 75 AutoReset<bool> reset(&ignore_calculate_bounds_, true);
76 drag_window_ = NULL; 76 drag_window_ = NULL;
77 Workspace* workspace = workspace_manager_->GetActiveWorkspace(); 77
78 if (workspace) 78 Workspace* workspace = workspace_manager_->FindBy(drag);
79 workspace->Layout(NULL, NULL); 79 workspace->Layout(NULL, NULL);
80 workspace->Activate();
80 workspace_manager_->SetOverview(false); 81 workspace_manager_->SetOverview(false);
81 } 82 }
82 83
83 void DefaultContainerLayoutManager::EndResize( 84 void DefaultContainerLayoutManager::EndResize(
84 aura::Window* drag, 85 aura::Window* drag,
85 aura::MouseEvent* evnet) { 86 aura::MouseEvent* evnet) {
86 AutoReset<bool> reset(&ignore_calculate_bounds_, true); 87 AutoReset<bool> reset(&ignore_calculate_bounds_, true);
87 drag_window_ = NULL; 88 drag_window_ = NULL;
88 Workspace* workspace = workspace_manager_->GetActiveWorkspace(); 89 Workspace* workspace = workspace_manager_->GetActiveWorkspace();
89 if (workspace) 90 if (workspace)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 158
158 Workspace* workspace = workspace_manager_->FindBy(child); 159 Workspace* workspace = workspace_manager_->FindBy(child);
159 gfx::Rect work_area = workspace->GetWorkAreaBounds(); 160 gfx::Rect work_area = workspace->GetWorkAreaBounds();
160 requested_bounds->set_origin( 161 requested_bounds->set_origin(
161 gfx::Point(child->GetTargetBounds().x(), work_area.y())); 162 gfx::Point(child->GetTargetBounds().x(), work_area.y()));
162 *requested_bounds = requested_bounds->AdjustToFit(work_area); 163 *requested_bounds = requested_bounds->AdjustToFit(work_area);
163 } 164 }
164 165
165 } // namespace internal 166 } // namespace internal
166 } // namespace aura_shell 167 } // namespace aura_shell
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698