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 "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
10 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
11 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
12 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
13 #include "ui/aura/window_property.h" | |
14 #include "ui/base/ui_base_types.h" | 14 #include "ui/base/ui_base_types.h" |
15 #include "ui/gfx/monitor.h" | 15 #include "ui/gfx/monitor.h" |
16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
17 | 17 |
18 DECLARE_WINDOW_PROPERTY_TYPE(bool); | |
19 | |
20 namespace ash { | 18 namespace ash { |
21 DEFINE_WINDOW_PROPERTY_KEY(bool, kOpenWindowSplitKey, false); | |
22 | |
23 namespace wm { | 19 namespace wm { |
24 | 20 |
25 void ActivateWindow(aura::Window* window) { | 21 void ActivateWindow(aura::Window* window) { |
26 DCHECK(window); | 22 DCHECK(window); |
27 DCHECK(window->GetRootWindow()); | 23 DCHECK(window->GetRootWindow()); |
28 aura::client::GetActivationClient(window->GetRootWindow())->ActivateWindow( | 24 aura::client::GetActivationClient(window->GetRootWindow())->ActivateWindow( |
29 window); | 25 window); |
30 } | 26 } |
31 | 27 |
32 void DeactivateWindow(aura::Window* window) { | 28 void DeactivateWindow(aura::Window* window) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 94 } |
99 | 95 |
100 void CenterWindow(aura::Window* window) { | 96 void CenterWindow(aura::Window* window) { |
101 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(window); | 97 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(window); |
102 gfx::Rect center = monitor.work_area().Center(window->bounds().size()); | 98 gfx::Rect center = monitor.work_area().Center(window->bounds().size()); |
103 window->SetBounds(center); | 99 window->SetBounds(center); |
104 } | 100 } |
105 | 101 |
106 } // namespace wm | 102 } // namespace wm |
107 } // namespace ash | 103 } // namespace ash |
OLD | NEW |