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 after retrieving the physical displays from the NDD. |
| 52 cached_displays_.insert(cached_displays_.end(), |
| 53 virtual_display_snapshots_.begin(), |
| 54 virtual_display_snapshots_.end()); |
| 55 |
51 if (cached_displays_.size() > 1 && background_color_argb_) | 56 if (cached_displays_.size() > 1 && background_color_argb_) |
52 delegate_->SetBackgroundColor(background_color_argb_); | 57 delegate_->SetBackgroundColor(background_color_argb_); |
53 | 58 |
54 // If the user hasn't requested a display state, update it using the requested | 59 // If the user hasn't requested a display state, update it using the requested |
55 // power state. | 60 // power state. |
56 if (new_display_state_ == MULTIPLE_DISPLAY_STATE_INVALID) | 61 if (new_display_state_ == MULTIPLE_DISPLAY_STATE_INVALID) |
57 new_display_state_ = ChooseDisplayState(); | 62 new_display_state_ = ChooseDisplayState(); |
58 | 63 |
59 VLOG(1) << "OnDisplaysUpdated: new_display_state=" | 64 VLOG(1) << "OnDisplaysUpdated: new_display_state=" |
60 << MultipleDisplayStateToString(new_display_state_) | 65 << MultipleDisplayStateToString(new_display_state_) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return layout_manager_->GetStateController()->GetStateForDisplayIds( | 204 return layout_manager_->GetStateController()->GetStateForDisplayIds( |
200 cached_displays_); | 205 cached_displays_); |
201 } | 206 } |
202 NOTREACHED(); | 207 NOTREACHED(); |
203 } | 208 } |
204 } | 209 } |
205 return MULTIPLE_DISPLAY_STATE_INVALID; | 210 return MULTIPLE_DISPLAY_STATE_INVALID; |
206 } | 211 } |
207 | 212 |
208 } // namespace ui | 213 } // namespace ui |
OLD | NEW |