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

Side by Side Diff: ash/wm/window_util.cc

Issue 10442017: Rename GetRootWindow() -> GetPrimaryRootWindow() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git-try -b linux_chromeos,win_aura Created 8 years, 7 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/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/activation_controller.h" 8 #include "ash/wm/activation_controller.h"
9 #include "ash/wm/window_properties.h" 9 #include "ash/wm/window_properties.h"
10 #include "ui/aura/client/activation_client.h" 10 #include "ui/aura/client/activation_client.h"
(...skipping 24 matching lines...) Expand all
35 bool IsActiveWindow(aura::Window* window) { 35 bool IsActiveWindow(aura::Window* window) {
36 DCHECK(window); 36 DCHECK(window);
37 if (!window->GetRootWindow()) 37 if (!window->GetRootWindow())
38 return false; 38 return false;
39 aura::client::ActivationClient* client = 39 aura::client::ActivationClient* client =
40 aura::client::GetActivationClient(window->GetRootWindow()); 40 aura::client::GetActivationClient(window->GetRootWindow());
41 return client && client->GetActiveWindow() == window; 41 return client && client->GetActiveWindow() == window;
42 } 42 }
43 43
44 aura::Window* GetActiveWindow() { 44 aura::Window* GetActiveWindow() {
45 return aura::client::GetActivationClient(Shell::GetRootWindow())-> 45 return aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())->
46 GetActiveWindow(); 46 GetActiveWindow();
47 } 47 }
48 48
49 aura::Window* GetActivatableWindow(aura::Window* window) { 49 aura::Window* GetActivatableWindow(aura::Window* window) {
50 return internal::ActivationController::GetActivatableWindow(window, NULL); 50 return internal::ActivationController::GetActivatableWindow(window, NULL);
51 } 51 }
52 52
53 bool CanActivateWindow(aura::Window* window) { 53 bool CanActivateWindow(aura::Window* window) {
54 DCHECK(window); 54 DCHECK(window);
55 if (!window->GetRootWindow()) 55 if (!window->GetRootWindow())
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 void CenterWindow(aura::Window* window) { 96 void CenterWindow(aura::Window* window) {
97 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(window); 97 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(window);
98 gfx::Rect center = monitor.work_area().Center(window->bounds().size()); 98 gfx::Rect center = monitor.work_area().Center(window->bounds().size());
99 window->SetBounds(center); 99 window->SetBounds(center);
100 } 100 }
101 101
102 } // namespace wm 102 } // namespace wm
103 } // namespace ash 103 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_modality_controller_unittest.cc ('k') | ash/wm/workspace/workspace_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698