| 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_layout.h" | 8 #include "ash/display/display_layout.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/rotator/screen_rotation_animator.h" | 10 #include "ash/rotator/screen_rotation_animator.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 display_animator_->StartFadeOutAnimation( | 75 display_animator_->StartFadeOutAnimation( |
| 76 base::Bind(&DisplayConfigurationController::SetDisplayLayoutImpl, | 76 base::Bind(&DisplayConfigurationController::SetDisplayLayoutImpl, |
| 77 weak_ptr_factory_.GetWeakPtr(), display_id, layout)); | 77 weak_ptr_factory_.GetWeakPtr(), display_id, layout)); |
| 78 } else { | 78 } else { |
| 79 SetDisplayLayoutImpl(display_id, layout); | 79 SetDisplayLayoutImpl(display_id, layout); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void DisplayConfigurationController::SetMirrorMode(bool mirror, | 83 void DisplayConfigurationController::SetMirrorMode(bool mirror, |
| 84 bool user_action) { | 84 bool user_action) { |
| 85 if (display_manager_->GetNumDisplays() <= 1 || | 85 if (display_manager_->num_connected_displays() <= 1 || |
| 86 display_manager_->IsInMirrorMode() == mirror || IsLimited()) { | 86 display_manager_->IsInMirrorMode() == mirror || IsLimited()) { |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 if (user_action && display_animator_) { | 89 if (user_action && display_animator_) { |
| 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 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( | 161 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( |
| 162 int64_t display_id) { | 162 int64_t display_id) { |
| 163 window_tree_host_manager_->SetPrimaryDisplayId(display_id); | 163 window_tree_host_manager_->SetPrimaryDisplayId(display_id); |
| 164 if (limiter_) | 164 if (limiter_) |
| 165 limiter_->SetThrottleTimeout(kSetPrimaryDisplayThrottleTimeoutMs); | 165 limiter_->SetThrottleTimeout(kSetPrimaryDisplayThrottleTimeoutMs); |
| 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 |