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

Side by Side Diff: ash/wm/workspace/workspace_manager.cc

Issue 9616045: Aura/Ash split: Move ScreenAura to ash::ScreenAsh. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a separate aura::TestScreen in tests instead, partially reverting to patchset 2 Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/workspace/workspace_manager.h" 5 #include "ash/wm/workspace/workspace_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/wm/property_util.h" 11 #include "ash/wm/property_util.h"
11 #include "ash/wm/shelf_layout_manager.h" 12 #include "ash/wm/shelf_layout_manager.h"
12 #include "ash/wm/window_animations.h" 13 #include "ash/wm/window_animations.h"
13 #include "ash/wm/window_resizer.h" 14 #include "ash/wm/window_resizer.h"
14 #include "ash/wm/window_util.h" 15 #include "ash/wm/window_util.h"
15 #include "ash/wm/workspace/managed_workspace.h" 16 #include "ash/wm/workspace/managed_workspace.h"
16 #include "ash/wm/workspace/maximized_workspace.h" 17 #include "ash/wm/workspace/maximized_workspace.h"
17 #include "base/auto_reset.h" 18 #include "base/auto_reset.h"
18 #include "base/logging.h" 19 #include "base/logging.h"
19 #include "base/stl_util.h" 20 #include "base/stl_util.h"
20 #include "ui/aura/client/aura_constants.h" 21 #include "ui/aura/client/aura_constants.h"
21 #include "ui/aura/root_window.h" 22 #include "ui/aura/root_window.h"
22 #include "ui/aura/screen_aura.h"
23 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
24 #include "ui/base/ui_base_types.h" 24 #include "ui/base/ui_base_types.h"
25 #include "ui/gfx/compositor/layer.h" 25 #include "ui/gfx/compositor/layer.h"
26 #include "ui/gfx/compositor/layer_animator.h" 26 #include "ui/gfx/compositor/layer_animator.h"
27 #include "ui/gfx/compositor/scoped_layer_animation_settings.h" 27 #include "ui/gfx/compositor/scoped_layer_animation_settings.h"
28 #include "ui/gfx/screen.h" 28 #include "ui/gfx/screen.h"
29 #include "ui/gfx/transform.h" 29 #include "ui/gfx/transform.h"
30 30
31 namespace { 31 namespace {
32 32
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 SetVisibilityOfWorkspaceWindows(active_workspace_, 281 SetVisibilityOfWorkspaceWindows(active_workspace_,
282 last_active ? ANIMATE : DONT_ANIMATE, true); 282 last_active ? ANIMATE : DONT_ANIMATE, true);
283 UpdateShelfVisibility(); 283 UpdateShelfVisibility();
284 } 284 }
285 285
286 is_overview_ = false; 286 is_overview_ = false;
287 } 287 }
288 288
289 gfx::Rect WorkspaceManager::GetWorkAreaBounds() { 289 gfx::Rect WorkspaceManager::GetWorkAreaBounds() {
290 gfx::Rect bounds(workspace_size_); 290 gfx::Rect bounds(workspace_size_);
291 bounds.Inset(Shell::GetRootWindow()->screen()->work_area_insets()); 291 bounds.Inset(Shell::GetInstance()->screen()->work_area_insets());
292 return bounds; 292 return bounds;
293 } 293 }
294 294
295 // Returns the index of the workspace that contains the |window|. 295 // Returns the index of the workspace that contains the |window|.
296 int WorkspaceManager::GetWorkspaceIndexContaining(aura::Window* window) const { 296 int WorkspaceManager::GetWorkspaceIndexContaining(aura::Window* window) const {
297 for (Workspaces::const_iterator i = workspaces_.begin(); 297 for (Workspaces::const_iterator i = workspaces_.begin();
298 i != workspaces_.end(); 298 i != workspaces_.end();
299 ++i) { 299 ++i) {
300 if ((*i)->Contains(window)) 300 if ((*i)->Contains(window))
301 return i - workspaces_.begin(); 301 return i - workspaces_.begin();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 if (type == Workspace::TYPE_MAXIMIZED) 357 if (type == Workspace::TYPE_MAXIMIZED)
358 workspace = new MaximizedWorkspace(this); 358 workspace = new MaximizedWorkspace(this);
359 else 359 else
360 workspace = new ManagedWorkspace(this); 360 workspace = new ManagedWorkspace(this);
361 AddWorkspace(workspace); 361 AddWorkspace(workspace);
362 return workspace; 362 return workspace;
363 } 363 }
364 364
365 } // namespace internal 365 } // namespace internal
366 } // namespace ash 366 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.cc ('k') | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698