| 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_util.h" | 8 #include "ash/display/display_util.h" |
| 9 #include "ash/rotator/screen_rotation_animator.h" | 9 #include "ash/rotator/screen_rotation_animator.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if (limiter_) | 153 if (limiter_) |
| 154 limiter_->SetThrottleTimeout(throttle_ms); | 154 limiter_->SetThrottleTimeout(throttle_ms); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool DisplayConfigurationController::IsLimited() { | 157 bool DisplayConfigurationController::IsLimited() { |
| 158 return limiter_ && limiter_->IsThrottled(); | 158 return limiter_ && limiter_->IsThrottled(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void DisplayConfigurationController::SetDisplayLayoutImpl( | 161 void DisplayConfigurationController::SetDisplayLayoutImpl( |
| 162 std::unique_ptr<display::DisplayLayout> layout) { | 162 std::unique_ptr<display::DisplayLayout> layout) { |
| 163 // TODO(oshima/stevenjb): Add support for 3+ displays. | |
| 164 display_manager_->SetLayoutForCurrentDisplays(std::move(layout)); | 163 display_manager_->SetLayoutForCurrentDisplays(std::move(layout)); |
| 165 if (display_animator_) | 164 if (display_animator_) |
| 166 display_animator_->StartFadeInAnimation(); | 165 display_animator_->StartFadeInAnimation(); |
| 167 } | 166 } |
| 168 | 167 |
| 169 void DisplayConfigurationController::SetMirrorModeImpl(bool mirror) { | 168 void DisplayConfigurationController::SetMirrorModeImpl(bool mirror) { |
| 170 display_manager_->SetMirrorMode(mirror); | 169 display_manager_->SetMirrorMode(mirror); |
| 171 if (display_animator_) | 170 if (display_animator_) |
| 172 display_animator_->StartFadeInAnimation(); | 171 display_animator_->StartFadeInAnimation(); |
| 173 } | 172 } |
| 174 | 173 |
| 175 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( | 174 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( |
| 176 int64_t display_id) { | 175 int64_t display_id) { |
| 177 window_tree_host_manager_->SetPrimaryDisplayId(display_id); | 176 window_tree_host_manager_->SetPrimaryDisplayId(display_id); |
| 178 if (display_animator_) | 177 if (display_animator_) |
| 179 display_animator_->StartFadeInAnimation(); | 178 display_animator_->StartFadeInAnimation(); |
| 180 } | 179 } |
| 181 | 180 |
| 182 } // namespace ash | 181 } // namespace ash |
| OLD | NEW |