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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
61 bool IsWindowUserPositionable(aura::Window* window) { | 61 bool IsWindowUserPositionable(aura::Window* window) { |
62 return GetWindowState(window)->IsUserPositionable(); | 62 return GetWindowState(window)->IsUserPositionable(); |
63 } | 63 } |
64 | 64 |
65 void PinWindow(aura::Window* window) { | 65 void PinWindow(aura::Window* window, bool trusted) { |
66 wm::WMEvent event(wm::WM_EVENT_PIN); | 66 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); |
67 wm::GetWindowState(window)->OnWMEvent(&event); | 67 wm::GetWindowState(window)->OnWMEvent(&event); |
68 } | 68 } |
69 | 69 |
70 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { | 70 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { |
71 views::View* target = static_cast<views::View*>(event.target()); | 71 views::View* target = static_cast<views::View*>(event.target()); |
72 if (!target) | 72 if (!target) |
73 return false; | 73 return false; |
74 aura::Window* target_root = | 74 aura::Window* target_root = |
75 target->GetWidget()->GetNativeView()->GetRootWindow(); | 75 target->GetWidget()->GetNativeView()->GetRootWindow(); |
76 if (!target_root || target_root == window->GetRootWindow()) | 76 if (!target_root || target_root == window->GetRootWindow()) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if (!container->layout_manager()) | 111 if (!container->layout_manager()) |
112 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); | 112 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); |
113 } else { | 113 } else { |
114 InstallSnapLayoutManagerToContainers(container); | 114 InstallSnapLayoutManagerToContainers(container); |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 } // namespace wm | 119 } // namespace wm |
120 } // namespace ash | 120 } // namespace ash |
OLD | NEW |