OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/multi_display_manager.h" | 5 #include "ash/display/multi_display_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 new_displays = updated_displays; | 186 new_displays = updated_displays; |
187 } | 187 } |
188 | 188 |
189 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 189 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
190 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); | 190 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); |
191 DisplayList removed_displays; | 191 DisplayList removed_displays; |
192 std::vector<size_t> changed_display_indices; | 192 std::vector<size_t> changed_display_indices; |
193 std::vector<size_t> added_display_indices; | 193 std::vector<size_t> added_display_indices; |
194 gfx::Display current_primary; | 194 gfx::Display current_primary; |
195 if (Shell::HasInstance()) | 195 if (Shell::HasInstance()) |
196 current_primary = gfx::Screen::GetPrimaryDisplay(); | 196 current_primary = Shell::GetAshScreen()->GetPrimaryDisplay(); |
197 | 197 |
198 for (DisplayList::iterator curr_iter = displays_.begin(), | 198 for (DisplayList::iterator curr_iter = displays_.begin(), |
199 new_iter = new_displays.begin(); | 199 new_iter = new_displays.begin(); |
200 curr_iter != displays_.end() || new_iter != new_displays.end();) { | 200 curr_iter != displays_.end() || new_iter != new_displays.end();) { |
201 if (curr_iter == displays_.end()) { | 201 if (curr_iter == displays_.end()) { |
202 // more displays in new list. | 202 // more displays in new list. |
203 added_display_indices.push_back(new_iter - new_displays.begin()); | 203 added_display_indices.push_back(new_iter - new_displays.begin()); |
204 ++new_iter; | 204 ++new_iter; |
205 } else if (new_iter == new_displays.end()) { | 205 } else if (new_iter == new_displays.end()) { |
206 // more displays in current list. | 206 // more displays in current list. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 DisplayList::iterator iter_to_update = to_update->begin(); | 451 DisplayList::iterator iter_to_update = to_update->begin(); |
452 DisplayList::const_iterator iter = displays_.begin(); | 452 DisplayList::const_iterator iter = displays_.begin(); |
453 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 453 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
454 ++iter, ++iter_to_update) { | 454 ++iter, ++iter_to_update) { |
455 (*iter_to_update).set_id((*iter).id()); | 455 (*iter_to_update).set_id((*iter).id()); |
456 } | 456 } |
457 } | 457 } |
458 | 458 |
459 } // namespace internal | 459 } // namespace internal |
460 } // namespace ash | 460 } // namespace ash |
OLD | NEW |