OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()) |
56 return false; | 56 return false; |
57 aura::client::ActivationClient* client = | 57 aura::client::ActivationClient* client = |
58 aura::client::GetActivationClient(window->GetRootWindow()); | 58 aura::client::GetActivationClient(window->GetRootWindow()); |
59 return client && client->CanActivateWindow(window); | 59 return client && client->CanActivateWindow(window); |
60 } | 60 } |
61 | 61 |
62 internal::RootWindowController* GetRootWindowController( | |
63 aura::RootWindow* root_window) { | |
64 return root_window->GetProperty(internal::kRootWindowControllerKey); | |
65 } | |
66 | |
67 bool IsWindowNormal(aura::Window* window) { | 62 bool IsWindowNormal(aura::Window* window) { |
68 return window->GetProperty(aura::client::kShowStateKey) == | 63 return window->GetProperty(aura::client::kShowStateKey) == |
69 ui::SHOW_STATE_NORMAL || | 64 ui::SHOW_STATE_NORMAL || |
70 window->GetProperty(aura::client::kShowStateKey) == | 65 window->GetProperty(aura::client::kShowStateKey) == |
71 ui::SHOW_STATE_DEFAULT; | 66 ui::SHOW_STATE_DEFAULT; |
72 } | 67 } |
73 | 68 |
74 bool IsWindowMaximized(aura::Window* window) { | 69 bool IsWindowMaximized(aura::Window* window) { |
75 return window->GetProperty(aura::client::kShowStateKey) == | 70 return window->GetProperty(aura::client::kShowStateKey) == |
76 ui::SHOW_STATE_MAXIMIZED; | 71 ui::SHOW_STATE_MAXIMIZED; |
(...skipping 22 matching lines...) Expand all Loading... |
99 } | 94 } |
100 | 95 |
101 void CenterWindow(aura::Window* window) { | 96 void CenterWindow(aura::Window* window) { |
102 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window); | 97 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window); |
103 gfx::Rect center = display.work_area().Center(window->bounds().size()); | 98 gfx::Rect center = display.work_area().Center(window->bounds().size()); |
104 window->SetBounds(center); | 99 window->SetBounds(center); |
105 } | 100 } |
106 | 101 |
107 } // namespace wm | 102 } // namespace wm |
108 } // namespace ash | 103 } // namespace ash |
OLD | NEW |