Chromium Code Reviews| Index: ash/wm/maximize_mode/maximize_mode_controller.cc |
| diff --git a/ash/wm/maximize_mode/maximize_mode_controller.cc b/ash/wm/maximize_mode/maximize_mode_controller.cc |
| index 61ce2f2205611a724a838ebb705b713a088f2055..3a86c16434eabc4bb98ce19fe9d93244cce61e5a 100644 |
| --- a/ash/wm/maximize_mode/maximize_mode_controller.cc |
| +++ b/ash/wm/maximize_mode/maximize_mode_controller.cc |
| @@ -132,7 +132,8 @@ void ScreenshotActionHandler::OnKeyEvent(ui::KeyEvent* event) { |
| MaximizeModeController::MaximizeModeController() |
| : rotation_locked_(false), |
| - have_seen_accelerometer_data_(false) { |
| + have_seen_accelerometer_data_(false), |
| + show_display_notifications_(true) { |
| Shell::GetInstance()->accelerometer_controller()->AddObserver(this); |
| } |
| @@ -235,8 +236,9 @@ void MaximizeModeController::HandleScreenRotation(const gfx::Vector3dF& lid) { |
| // Also, SetDisplayRotation will save the setting to the local store, |
| // this should be stored in a way that we can distinguish what the |
| // rotation was set by. |
| - display_manager->SetDisplayRotation(gfx::Display::InternalDisplayId(), |
| - gfx::Display::ROTATE_0); |
| + SetDisplayRotation(display_manager, |
| + gfx::Display::InternalDisplayId(), |
| + gfx::Display::ROTATE_0); |
| } |
| rotation_locked_ = false; |
| return; |
| @@ -294,9 +296,22 @@ void MaximizeModeController::HandleScreenRotation(const gfx::Vector3dF& lid) { |
| // match screen orientation. |
| if (new_rotation == gfx::Display::ROTATE_0 || |
| maximize_mode_engaged) { |
| - display_manager->SetDisplayRotation(gfx::Display::InternalDisplayId(), |
| - new_rotation); |
| + SetDisplayRotation(display_manager, |
| + gfx::Display::InternalDisplayId(), |
| + new_rotation); |
| } |
| } |
| +void MaximizeModeController::SetDisplayRotation( |
| + DisplayManager* display_manager, |
| + int64 display_id, |
|
jonross
2014/05/14 01:00:39
We only ever operate on the internal display, this
bruthig
2014/05/14 18:48:49
Done.
|
| + gfx::Display::Rotation rotation) { |
| + // Suppress message centre notifications for screen rotations caused |
| + // by accelerometer events because it should be obvious why the orientation |
| + // changed. |
| + show_display_notifications_ = false; |
|
flackr
2014/05/14 01:48:33
nit: Use base::AutoReset.
bruthig
2014/05/14 18:48:49
Done.
|
| + display_manager->SetDisplayRotation(display_id, rotation); |
| + show_display_notifications_ = true; |
| +} |
| + |
| } // namespace ash |