| 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/common/strings/grit/ash_strings.h" | 7 #include "ash/common/strings/grit/ash_strings.h" |
| 8 #include "ash/display/display_animator.h" | 8 #include "ash/display/display_animator.h" |
| 9 #include "ash/display/display_animator_chromeos.h" | 9 #include "ash/display/display_animator_chromeos.h" |
| 10 #include "ash/display/display_util.h" | 10 #include "ash/display/display_util.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 base::Bind(&DisplayConfigurationController::SetMirrorModeImpl, | 96 base::Bind(&DisplayConfigurationController::SetMirrorModeImpl, |
| 97 weak_ptr_factory_.GetWeakPtr(), mirror)); | 97 weak_ptr_factory_.GetWeakPtr(), mirror)); |
| 98 } else { | 98 } else { |
| 99 SetMirrorModeImpl(mirror); | 99 SetMirrorModeImpl(mirror); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 void DisplayConfigurationController::SetDisplayRotation( | 103 void DisplayConfigurationController::SetDisplayRotation( |
| 104 int64_t display_id, | 104 int64_t display_id, |
| 105 display::Display::Rotation rotation, | 105 display::Display::Rotation rotation, |
| 106 display::Display::RotationSource source, | 106 display::Display::RotationSource source) { |
| 107 bool user_action) { | |
| 108 ash::ScreenRotationAnimator screen_rotation_animator(display_id); | 107 ash::ScreenRotationAnimator screen_rotation_animator(display_id); |
| 109 if (user_action && screen_rotation_animator.CanAnimate()) | 108 if (screen_rotation_animator.CanAnimate()) |
| 110 screen_rotation_animator.Rotate(rotation, source); | 109 screen_rotation_animator.Rotate(rotation, source); |
| 111 else | 110 else |
| 112 display_manager_->SetDisplayRotation(display_id, rotation, source); | 111 display_manager_->SetDisplayRotation(display_id, rotation, source); |
| 113 } | 112 } |
| 114 | 113 |
| 115 void DisplayConfigurationController::SetPrimaryDisplayId(int64_t display_id, | 114 void DisplayConfigurationController::SetPrimaryDisplayId(int64_t display_id, |
| 116 bool user_action) { | 115 bool user_action) { |
| 117 if (display_manager_->GetNumDisplays() <= 1 || IsLimited()) | 116 if (display_manager_->GetNumDisplays() <= 1 || IsLimited()) |
| 118 return; | 117 return; |
| 119 | 118 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 164 } |
| 166 | 165 |
| 167 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( | 166 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( |
| 168 int64_t display_id) { | 167 int64_t display_id) { |
| 169 window_tree_host_manager_->SetPrimaryDisplayId(display_id); | 168 window_tree_host_manager_->SetPrimaryDisplayId(display_id); |
| 170 if (display_animator_) | 169 if (display_animator_) |
| 171 display_animator_->StartFadeInAnimation(); | 170 display_animator_->StartFadeInAnimation(); |
| 172 } | 171 } |
| 173 | 172 |
| 174 } // namespace ash | 173 } // namespace ash |
| OLD | NEW |