| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/display/chromeos/update_display_configuration_task.h" | 5 #include "ui/display/chromeos/update_display_configuration_task.h" |
| 6 | 6 |
| 7 #include "ui/display/chromeos/configure_displays_task.h" | 7 #include "ui/display/chromeos/configure_displays_task.h" |
| 8 #include "ui/display/chromeos/display_layout_manager.h" | 8 #include "ui/display/chromeos/display_layout_manager.h" |
| 9 #include "ui/display/chromeos/display_util.h" | 9 #include "ui/display/chromeos/display_util.h" |
| 10 #include "ui/display/types/display_snapshot.h" | 10 #include "ui/display/types/display_snapshot.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void UpdateDisplayConfigurationTask::Run() { | 41 void UpdateDisplayConfigurationTask::Run() { |
| 42 delegate_->GetDisplays( | 42 delegate_->GetDisplays( |
| 43 base::Bind(&UpdateDisplayConfigurationTask::OnDisplaysUpdated, | 43 base::Bind(&UpdateDisplayConfigurationTask::OnDisplaysUpdated, |
| 44 weak_ptr_factory_.GetWeakPtr())); | 44 weak_ptr_factory_.GetWeakPtr())); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void UpdateDisplayConfigurationTask::OnDisplaysUpdated( | 47 void UpdateDisplayConfigurationTask::OnDisplaysUpdated( |
| 48 const std::vector<DisplaySnapshot*>& displays) { | 48 const std::vector<DisplaySnapshot*>& displays) { |
| 49 cached_displays_ = displays; | 49 cached_displays_ = displays; |
| 50 | 50 |
| 51 // Add virtual displays if present. |
| 52 for (const auto display : virtual_display_snapshots_) |
| 53 cached_displays_.push_back(display); |
| 54 |
| 51 if (cached_displays_.size() > 1 && background_color_argb_) | 55 if (cached_displays_.size() > 1 && background_color_argb_) |
| 52 delegate_->SetBackgroundColor(background_color_argb_); | 56 delegate_->SetBackgroundColor(background_color_argb_); |
| 53 | 57 |
| 54 // If the user hasn't requested a display state, update it using the requested | 58 // If the user hasn't requested a display state, update it using the requested |
| 55 // power state. | 59 // power state. |
| 56 if (new_display_state_ == MULTIPLE_DISPLAY_STATE_INVALID) | 60 if (new_display_state_ == MULTIPLE_DISPLAY_STATE_INVALID) |
| 57 new_display_state_ = ChooseDisplayState(); | 61 new_display_state_ = ChooseDisplayState(); |
| 58 | 62 |
| 59 VLOG(1) << "OnDisplaysUpdated: new_display_state=" | 63 VLOG(1) << "OnDisplaysUpdated: new_display_state=" |
| 60 << MultipleDisplayStateToString(new_display_state_) | 64 << MultipleDisplayStateToString(new_display_state_) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 return layout_manager_->GetStateController()->GetStateForDisplayIds( | 203 return layout_manager_->GetStateController()->GetStateForDisplayIds( |
| 200 cached_displays_); | 204 cached_displays_); |
| 201 } | 205 } |
| 202 NOTREACHED(); | 206 NOTREACHED(); |
| 203 } | 207 } |
| 204 } | 208 } |
| 205 return MULTIPLE_DISPLAY_STATE_INVALID; | 209 return MULTIPLE_DISPLAY_STATE_INVALID; |
| 206 } | 210 } |
| 207 | 211 |
| 208 } // namespace ui | 212 } // namespace ui |
| OLD | NEW |