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 { | |
jonross
2015/04/10 17:54:43
No longer used. Their removal was missed in a diff
| |
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 | |
175 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non | 165 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non |
176 // null value initial value. | 166 // null value initial value. |
177 void AttachTickClockForTest() { | 167 void AttachTickClockForTest() { |
178 scoped_ptr<base::TickClock> tick_clock( | 168 scoped_ptr<base::TickClock> tick_clock( |
179 test_tick_clock_ = new base::SimpleTestTickClock()); | 169 test_tick_clock_ = new base::SimpleTestTickClock()); |
180 test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); | 170 test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); |
181 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); | 171 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); |
182 } | 172 } |
183 | 173 |
184 void AdvanceTickClock(const base::TimeDelta& delta) { | 174 void AdvanceTickClock(const base::TimeDelta& delta) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 // accelerometer updates which would normally cause it to exit do not. | 508 // accelerometer updates which would normally cause it to exit do not. |
519 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { | 509 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { |
520 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); | 510 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); |
521 | 511 |
522 // Would normally trigger an exit from maximize mode. | 512 // Would normally trigger an exit from maximize mode. |
523 OpenLidToAngle(90.0f); | 513 OpenLidToAngle(90.0f); |
524 EXPECT_TRUE(IsMaximizeModeStarted()); | 514 EXPECT_TRUE(IsMaximizeModeStarted()); |
525 } | 515 } |
526 | 516 |
527 } // namespace ash | 517 } // namespace ash |
OLD | NEW |