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

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

Issue 8771015: Rename Desktop->RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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
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/workspace/workspace.h" 5 #include "ui/aura_shell/workspace/workspace.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
11 #include "ui/aura/desktop.h" 11 #include "ui/aura/root_window.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/aura_shell/property_util.h" 13 #include "ui/aura_shell/property_util.h"
14 #include "ui/aura_shell/workspace/workspace_manager.h" 14 #include "ui/aura_shell/workspace/workspace_manager.h"
15 #include "ui/base/ui_base_types.h" 15 #include "ui/base/ui_base_types.h"
16 #include "ui/gfx/compositor/layer.h" 16 #include "ui/gfx/compositor/layer.h"
17 #include "ui/gfx/compositor/layer_animator.h" 17 #include "ui/gfx/compositor/layer_animator.h"
18 18
19 namespace { 19 namespace {
20 // Horizontal margin between windows. 20 // Horizontal margin between windows.
21 const int kWindowHorizontalMargin = 10; 21 const int kWindowHorizontalMargin = 10;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 windows_.erase(std::find(windows_.begin(), windows_.end(), window)); 88 windows_.erase(std::find(windows_.begin(), windows_.end(), window));
89 Layout(NULL); 89 Layout(NULL);
90 } 90 }
91 91
92 bool Workspace::Contains(aura::Window* window) const { 92 bool Workspace::Contains(aura::Window* window) const {
93 return std::find(windows_.begin(), windows_.end(), window) != windows_.end(); 93 return std::find(windows_.begin(), windows_.end(), window) != windows_.end();
94 } 94 }
95 95
96 aura::Window* Workspace::FindRotateWindowForLocation( 96 aura::Window* Workspace::FindRotateWindowForLocation(
97 const gfx::Point& position) { 97 const gfx::Point& position) {
98 aura::Window* active = aura::Desktop::GetInstance()->active_window(); 98 aura::Window* active = aura::RootWindow::GetInstance()->active_window();
99 if (GetTotalWindowsWidth() < bounds_.width()) { 99 if (GetTotalWindowsWidth() < bounds_.width()) {
100 // If all windows fit to the width of the workspace, it returns the 100 // If all windows fit to the width of the workspace, it returns the
101 // window which contains |position|'s x coordinate. 101 // window which contains |position|'s x coordinate.
102 for (aura::Window::Windows::const_iterator i = windows_.begin(); 102 for (aura::Window::Windows::const_iterator i = windows_.begin();
103 i != windows_.end(); 103 i != windows_.end();
104 ++i) { 104 ++i) {
105 if (active == *i) 105 if (active == *i)
106 continue; 106 continue;
107 gfx::Rect bounds = (*i)->GetTargetBounds(); 107 gfx::Rect bounds = (*i)->GetTargetBounds();
108 if (bounds.x() < position.x() && position.x() < bounds.right()) 108 if (bounds.x() < position.x() && position.x() < bounds.right())
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 // static 276 // static
277 size_t Workspace::SetMaxWindowsCount(size_t max) { 277 size_t Workspace::SetMaxWindowsCount(size_t max) {
278 int old = g_max_windows_per_workspace; 278 int old = g_max_windows_per_workspace;
279 g_max_windows_per_workspace = max; 279 g_max_windows_per_workspace = max;
280 return old; 280 return old;
281 } 281 }
282 282
283 } // namespace internal 283 } // namespace internal
284 } // namespace aura_shell 284 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/toplevel_window_event_filter_unittest.cc ('k') | ui/aura_shell/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698