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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 207 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
208 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); | 208 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); |
209 DisplayList removed_displays; | 209 DisplayList removed_displays; |
210 std::vector<size_t> changed_display_indices; | 210 std::vector<size_t> changed_display_indices; |
211 std::vector<size_t> added_display_indices; | 211 std::vector<size_t> added_display_indices; |
212 gfx::Display current_primary; | 212 gfx::Display current_primary; |
213 if (Shell::HasInstance()) | 213 if (Shell::HasInstance()) |
214 current_primary = gfx::Screen::GetPrimaryDisplay(); | 214 current_primary = Shell::GetScreen()->GetPrimaryDisplay(); |
215 | 215 |
216 for (DisplayList::iterator curr_iter = displays_.begin(), | 216 for (DisplayList::iterator curr_iter = displays_.begin(), |
217 new_iter = new_displays.begin(); | 217 new_iter = new_displays.begin(); |
218 curr_iter != displays_.end() || new_iter != new_displays.end();) { | 218 curr_iter != displays_.end() || new_iter != new_displays.end();) { |
219 if (curr_iter == displays_.end()) { | 219 if (curr_iter == displays_.end()) { |
220 // more displays in new list. | 220 // more displays in new list. |
221 added_display_indices.push_back(new_iter - new_displays.begin()); | 221 added_display_indices.push_back(new_iter - new_displays.begin()); |
222 ++new_iter; | 222 ++new_iter; |
223 } else if (new_iter == new_displays.end()) { | 223 } else if (new_iter == new_displays.end()) { |
224 // more displays in current list. | 224 // more displays in current list. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 DisplayList::iterator iter_to_update = to_update->begin(); | 469 DisplayList::iterator iter_to_update = to_update->begin(); |
470 DisplayList::const_iterator iter = displays_.begin(); | 470 DisplayList::const_iterator iter = displays_.begin(); |
471 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 471 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
472 ++iter, ++iter_to_update) { | 472 ++iter, ++iter_to_update) { |
473 (*iter_to_update).set_id((*iter).id()); | 473 (*iter_to_update).set_id((*iter).id()); |
474 } | 474 } |
475 } | 475 } |
476 | 476 |
477 } // namespace internal | 477 } // namespace internal |
478 } // namespace ash | 478 } // namespace ash |
OLD | NEW |