OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/chromeos/rotation/tray_rotation_lock.h" | 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/ash_switches.h" | |
10 #include "ash/common/system/status_area_widget.h" | 9 #include "ash/common/system/status_area_widget.h" |
11 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
12 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
13 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
14 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
15 #include "ash/display/display_manager.h" | 14 #include "ash/display/display_manager.h" |
16 #include "ash/display/screen_orientation_controller_chromeos.h" | 15 #include "ash/display/screen_orientation_controller_chromeos.h" |
17 #include "ash/root_window_controller.h" | 16 #include "ash/root_window_controller.h" |
18 #include "ash/shell.h" | 17 #include "ash/shell.h" |
19 #include "ash/test/ash_test_base.h" | 18 #include "ash/test/ash_test_base.h" |
20 #include "ash/test/status_area_widget_test_helper.h" | 19 #include "ash/test/status_area_widget_test_helper.h" |
21 #include "base/command_line.h" | 20 #include "base/command_line.h" |
22 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "ui/display/display_switches.h" |
23 #include "ui/events/event.h" | 23 #include "ui/events/event.h" |
24 #include "ui/events/event_constants.h" | 24 #include "ui/events/event_constants.h" |
25 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
26 | 26 |
27 namespace ash { | 27 namespace ash { |
28 | 28 |
29 class TrayRotationLockTest : public test::AshTestBase { | 29 class TrayRotationLockTest : public test::AshTestBase { |
30 public: | 30 public: |
31 TrayRotationLockTest() {} | 31 TrayRotationLockTest() {} |
32 ~TrayRotationLockTest() override {} | 32 ~TrayRotationLockTest() override {} |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 tray_view_.reset(); | 91 tray_view_.reset(); |
92 default_view_.reset(); | 92 default_view_.reset(); |
93 tray_.reset(); | 93 tray_.reset(); |
94 } | 94 } |
95 | 95 |
96 void TrayRotationLockTest::SetUp() { | 96 void TrayRotationLockTest::SetUp() { |
97 // The Display used for testing is not an internal display. This flag | 97 // The Display used for testing is not an internal display. This flag |
98 // allows for DisplayManager to treat it as one. TrayRotationLock is only | 98 // allows for DisplayManager to treat it as one. TrayRotationLock is only |
99 // visible on internal primary displays. | 99 // visible on internal primary displays. |
100 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 100 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
101 switches::kAshUseFirstDisplayAsInternal); | 101 ::switches::kUseFirstDisplayAsInternal); |
102 test::AshTestBase::SetUp(); | 102 test::AshTestBase::SetUp(); |
103 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 103 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
104 } | 104 } |
105 | 105 |
106 void TrayRotationLockTest::TearDown() { | 106 void TrayRotationLockTest::TearDown() { |
107 TearDownViews(); | 107 TearDownViews(); |
108 test::AshTestBase::TearDown(); | 108 test::AshTestBase::TearDown(); |
109 } | 109 } |
110 | 110 |
111 // Tests that when the tray view is initially created, that it is created | 111 // Tests that when the tray view is initially created, that it is created |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 261 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
262 true); | 262 true); |
263 DestroyTrayView(); | 263 DestroyTrayView(); |
264 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( | 264 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( |
265 true); | 265 true); |
266 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 266 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
267 false); | 267 false); |
268 } | 268 } |
269 | 269 |
270 } // namespace ash | 270 } // namespace ash |
OLD | NEW |