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 <math.h> | 5 #include <math.h> |
6 #include <map> | 6 #include <map> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 9 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 base.y(), base.z()); | 155 base.y(), base.z()); |
156 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), | 156 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), |
157 lid.z()); | 157 lid.z()); |
158 maximize_mode_controller()->OnAccelerometerUpdated(update); | 158 maximize_mode_controller()->OnAccelerometerUpdated(update); |
159 } | 159 } |
160 | 160 |
161 bool IsMaximizeModeStarted() { | 161 bool IsMaximizeModeStarted() { |
162 return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); | 162 return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); |
163 } | 163 } |
164 | 164 |
| 165 gfx::Display::Rotation GetInternalDisplayRotation() const { |
| 166 return Shell::GetInstance()->display_manager()->GetDisplayInfo( |
| 167 gfx::Display::InternalDisplayId()).rotation(); |
| 168 } |
| 169 |
| 170 void SetInternalDisplayRotation(gfx::Display::Rotation rotation) const { |
| 171 Shell::GetInstance()->display_manager()-> |
| 172 SetDisplayRotation(gfx::Display::InternalDisplayId(), rotation); |
| 173 } |
| 174 |
165 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non | 175 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non |
166 // null value initial value. | 176 // null value initial value. |
167 void AttachTickClockForTest() { | 177 void AttachTickClockForTest() { |
168 scoped_ptr<base::TickClock> tick_clock( | 178 scoped_ptr<base::TickClock> tick_clock( |
169 test_tick_clock_ = new base::SimpleTestTickClock()); | 179 test_tick_clock_ = new base::SimpleTestTickClock()); |
170 test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); | 180 test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); |
171 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); | 181 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); |
172 } | 182 } |
173 | 183 |
174 void AdvanceTickClock(const base::TimeDelta& delta) { | 184 void AdvanceTickClock(const base::TimeDelta& delta) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 // accelerometer updates which would normally cause it to exit do not. | 518 // accelerometer updates which would normally cause it to exit do not. |
509 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { | 519 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { |
510 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); | 520 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); |
511 | 521 |
512 // Would normally trigger an exit from maximize mode. | 522 // Would normally trigger an exit from maximize mode. |
513 OpenLidToAngle(90.0f); | 523 OpenLidToAngle(90.0f); |
514 EXPECT_TRUE(IsMaximizeModeStarted()); | 524 EXPECT_TRUE(IsMaximizeModeStarted()); |
515 } | 525 } |
516 | 526 |
517 } // namespace ash | 527 } // namespace ash |
OLD | NEW |