| 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/display/display_configuration_controller.h" | 5 #include "ash/display/display_configuration_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_animator.h" | 7 #include "ash/display/display_animator.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/rotator/screen_rotation_animator.h" | 9 #include "ash/rotator/screen_rotation_animator.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 display_animator_->StartFadeOutAnimation( | 90 display_animator_->StartFadeOutAnimation( |
| 91 base::Bind(&DisplayConfigurationController::SetMirrorModeImpl, | 91 base::Bind(&DisplayConfigurationController::SetMirrorModeImpl, |
| 92 weak_ptr_factory_.GetWeakPtr(), mirror)); | 92 weak_ptr_factory_.GetWeakPtr(), mirror)); |
| 93 } else { | 93 } else { |
| 94 SetMirrorModeImpl(mirror); | 94 SetMirrorModeImpl(mirror); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 void DisplayConfigurationController::SetDisplayRotation( | 98 void DisplayConfigurationController::SetDisplayRotation( |
| 99 int64_t display_id, | 99 int64_t display_id, |
| 100 gfx::Display::Rotation rotation, | 100 display::Display::Rotation rotation, |
| 101 gfx::Display::RotationSource source, | 101 display::Display::RotationSource source, |
| 102 bool user_action) { | 102 bool user_action) { |
| 103 ash::ScreenRotationAnimator screen_rotation_animator(display_id); | 103 ash::ScreenRotationAnimator screen_rotation_animator(display_id); |
| 104 if (user_action && screen_rotation_animator.CanAnimate()) | 104 if (user_action && screen_rotation_animator.CanAnimate()) |
| 105 screen_rotation_animator.Rotate(rotation, source); | 105 screen_rotation_animator.Rotate(rotation, source); |
| 106 else | 106 else |
| 107 display_manager_->SetDisplayRotation(display_id, rotation, source); | 107 display_manager_->SetDisplayRotation(display_id, rotation, source); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void DisplayConfigurationController::SetPrimaryDisplayId(int64_t display_id, | 110 void DisplayConfigurationController::SetPrimaryDisplayId(int64_t display_id, |
| 111 bool user_action) { | 111 bool user_action) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( | 163 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( |
| 164 int64_t display_id) { | 164 int64_t display_id) { |
| 165 window_tree_host_manager_->SetPrimaryDisplayId(display_id); | 165 window_tree_host_manager_->SetPrimaryDisplayId(display_id); |
| 166 if (display_animator_) | 166 if (display_animator_) |
| 167 display_animator_->StartFadeInAnimation(); | 167 display_animator_->StartFadeInAnimation(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace ash | 170 } // namespace ash |
| OLD | NEW |