OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/screen_pinning_controller.h" | 5 #include "ash/wm/screen_pinning_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
12 #include "ash/wm/screen_pinning_controller.h" | 12 #include "ash/wm/screen_pinning_controller.h" |
13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
15 #include "ash/wm/wm_event.h" | 15 #include "ash/wm/wm_event.h" |
16 #include "ash/wm_shell.h" | |
17 #include "ash/wm_window.h" | 16 #include "ash/wm_window.h" |
18 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
19 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
20 | 19 |
21 namespace ash { | 20 namespace ash { |
22 namespace { | 21 namespace { |
23 | 22 |
24 int FindIndex(const std::vector<aura::Window*>& windows, | 23 int FindIndex(const std::vector<aura::Window*>& windows, |
25 const aura::Window* target) { | 24 const aura::Window* target) { |
26 auto iter = std::find(windows.begin(), windows.end(), target); | 25 auto iter = std::find(windows.begin(), windows.end(), target); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 wm::PinWindow(w1, /* trusted */ true); | 160 wm::PinWindow(w1, /* trusted */ true); |
162 EXPECT_TRUE(Shell::Get()->screen_pinning_controller()->IsPinned()); | 161 EXPECT_TRUE(Shell::Get()->screen_pinning_controller()->IsPinned()); |
163 | 162 |
164 Shell::Get()->accelerator_controller()->PerformActionIfEnabled(UNPIN); | 163 Shell::Get()->accelerator_controller()->PerformActionIfEnabled(UNPIN); |
165 // The UNPIN accelerator key is disabled for trusted pinned and the window | 164 // The UNPIN accelerator key is disabled for trusted pinned and the window |
166 // must be still pinned. | 165 // must be still pinned. |
167 EXPECT_TRUE(Shell::Get()->screen_pinning_controller()->IsPinned()); | 166 EXPECT_TRUE(Shell::Get()->screen_pinning_controller()->IsPinned()); |
168 } | 167 } |
169 | 168 |
170 } // namespace ash | 169 } // namespace ash |
OLD | NEW |