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

Side by Side Diff: ui/aura_shell/workspace/workspace_manager.cc

Issue 8399044: aura: Make sure the desktop widget gets parented to the correct container. (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 | « ui/aura_shell/examples/lock_view.cc ('k') | 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 #include "ui/aura_shell/workspace/workspace_manager.h" 4 #include "ui/aura_shell/workspace/workspace_manager.h"
5 5
6 #include <algorithm> 6 #include <algorithm>
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "ui/aura/desktop.h" 9 #include "ui/aura/desktop.h"
10 #include "ui/aura/screen_aura.h" 10 #include "ui/aura/screen_aura.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } else if (active_workspace_) { 113 } else if (active_workspace_) {
114 // Center the active workspace. 114 // Center the active workspace.
115 int active_workspace_mid_x = (active_workspace_->bounds().x() + 115 int active_workspace_mid_x = (active_workspace_->bounds().x() +
116 active_workspace_->bounds().width() / 2) * scale; 116 active_workspace_->bounds().width() / 2) * scale;
117 dx = workspace_size_.width() / 2 - active_workspace_mid_x; 117 dx = workspace_size_.width() / 2 - active_workspace_mid_x;
118 dx = std::min(0, std::max(dx, workspace_size_.width() - overview_width)); 118 dx = std::min(0, std::max(dx, workspace_size_.width() - overview_width));
119 } 119 }
120 120
121 transform.SetTranslateX(dx); 121 transform.SetTranslateX(dx);
122 transform.SetTranslateY(workspace_size_.height() * (1.0f - scale) / 2); 122 transform.SetTranslateY(workspace_size_.height() * (1.0f - scale) / 2);
123 } else { 123 } else if (active_workspace_) {
124 transform.SetTranslateX(-active_workspace_->bounds().x()); 124 transform.SetTranslateX(-active_workspace_->bounds().x());
125 } 125 }
126 126
127 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation()); 127 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation());
128 viewport_->layer()->SetTransform(transform); 128 viewport_->layer()->SetTransform(transform);
129 } 129 }
130 130
131 //////////////////////////////////////////////////////////////////////////////// 131 ////////////////////////////////////////////////////////////////////////////////
132 // WorkspaceManager, Overridden from aura::DesktopObserver: 132 // WorkspaceManager, Overridden from aura::DesktopObserver:
133 133
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Move to active workspace. 198 // Move to active workspace.
199 if (active_workspace_) { 199 if (active_workspace_) {
200 ui::Transform transform; 200 ui::Transform transform;
201 transform.SetTranslateX(-active_workspace_->bounds().x()); 201 transform.SetTranslateX(-active_workspace_->bounds().x());
202 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation()); 202 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation());
203 viewport_->SetTransform(transform); 203 viewport_->SetTransform(transform);
204 } 204 }
205 } 205 }
206 206
207 } // namespace aura_shell 207 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/examples/lock_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698