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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 void DeactivateWindow(aura::Window* window) { | 40 void DeactivateWindow(aura::Window* window) { |
41 ::wm::DeactivateWindow(window); | 41 ::wm::DeactivateWindow(window); |
42 } | 42 } |
43 | 43 |
44 bool IsActiveWindow(aura::Window* window) { | 44 bool IsActiveWindow(aura::Window* window) { |
45 return ::wm::IsActiveWindow(window); | 45 return ::wm::IsActiveWindow(window); |
46 } | 46 } |
47 | 47 |
48 aura::Window* GetActiveWindow() { | 48 aura::Window* GetActiveWindow() { |
49 return aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())-> | 49 return aura::client::GetActivationClient(Shell::GetPrimaryRootWindow()) |
50 GetActiveWindow(); | 50 ->GetActiveWindow(); |
51 } | 51 } |
52 | 52 |
53 aura::Window* GetActivatableWindow(aura::Window* window) { | 53 aura::Window* GetActivatableWindow(aura::Window* window) { |
54 return ::wm::GetActivatableWindow(window); | 54 return ::wm::GetActivatableWindow(window); |
55 } | 55 } |
56 | 56 |
57 bool CanActivateWindow(aura::Window* window) { | 57 bool CanActivateWindow(aura::Window* window) { |
58 return ::wm::CanActivateWindow(window); | 58 return ::wm::CanActivateWindow(window); |
59 } | 59 } |
60 | 60 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { | 102 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { |
103 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) | 103 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) |
104 << container->name(); | 104 << container->name(); |
105 container->SetProperty(kSnapChildrenToPixelBoundary, true); | 105 container->SetProperty(kSnapChildrenToPixelBoundary, true); |
106 } | 106 } |
107 | 107 |
108 void InstallSnapLayoutManagerToContainers(aura::Window* parent) { | 108 void InstallSnapLayoutManagerToContainers(aura::Window* parent) { |
109 aura::Window::Windows children = parent->children(); | 109 aura::Window::Windows children = parent->children(); |
110 for (aura::Window::Windows::iterator iter = children.begin(); | 110 for (aura::Window::Windows::iterator iter = children.begin(); |
111 iter != children.end(); | 111 iter != children.end(); ++iter) { |
112 ++iter) { | |
113 aura::Window* container = *iter; | 112 aura::Window* container = *iter; |
114 if (container->id() < 0) // not a container | 113 if (container->id() < 0) // not a container |
115 continue; | 114 continue; |
116 if (container->GetProperty(kSnapChildrenToPixelBoundary)) { | 115 if (container->GetProperty(kSnapChildrenToPixelBoundary)) { |
117 if (!container->layout_manager()) | 116 if (!container->layout_manager()) |
118 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); | 117 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); |
119 } else { | 118 } else { |
120 InstallSnapLayoutManagerToContainers(container); | 119 InstallSnapLayoutManagerToContainers(container); |
121 } | 120 } |
122 } | 121 } |
123 } | 122 } |
124 | 123 |
125 } // namespace wm | 124 } // namespace wm |
126 } // namespace ash | 125 } // namespace ash |
OLD | NEW |