| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 new_displays = updated_displays; | 187 new_displays = updated_displays; |
| 188 } | 188 } |
| 189 | 189 |
| 190 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 190 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
| 191 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); | 191 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); |
| 192 DisplayList removed_displays; | 192 DisplayList removed_displays; |
| 193 std::vector<size_t> changed_display_indices; | 193 std::vector<size_t> changed_display_indices; |
| 194 std::vector<size_t> added_display_indices; | 194 std::vector<size_t> added_display_indices; |
| 195 gfx::Display current_primary; | 195 gfx::Display current_primary; |
| 196 if (Shell::HasInstance()) | 196 if (Shell::HasInstance()) |
| 197 current_primary = gfx::Screen::GetPrimaryDisplay(); | 197 current_primary = Shell::GetAshScreen()->GetPrimaryDisplay(); |
| 198 | 198 |
| 199 for (DisplayList::iterator curr_iter = displays_.begin(), | 199 for (DisplayList::iterator curr_iter = displays_.begin(), |
| 200 new_iter = new_displays.begin(); | 200 new_iter = new_displays.begin(); |
| 201 curr_iter != displays_.end() || new_iter != new_displays.end();) { | 201 curr_iter != displays_.end() || new_iter != new_displays.end();) { |
| 202 if (curr_iter == displays_.end()) { | 202 if (curr_iter == displays_.end()) { |
| 203 // more displays in new list. | 203 // more displays in new list. |
| 204 added_display_indices.push_back(new_iter - new_displays.begin()); | 204 added_display_indices.push_back(new_iter - new_displays.begin()); |
| 205 ++new_iter; | 205 ++new_iter; |
| 206 } else if (new_iter == new_displays.end()) { | 206 } else if (new_iter == new_displays.end()) { |
| 207 // more displays in current list. | 207 // more displays in current list. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 DisplayList::iterator iter_to_update = to_update->begin(); | 452 DisplayList::iterator iter_to_update = to_update->begin(); |
| 453 DisplayList::const_iterator iter = displays_.begin(); | 453 DisplayList::const_iterator iter = displays_.begin(); |
| 454 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 454 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
| 455 ++iter, ++iter_to_update) { | 455 ++iter, ++iter_to_update) { |
| 456 (*iter_to_update).set_id((*iter).id()); | 456 (*iter_to_update).set_id((*iter).id()); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 } // namespace internal | 460 } // namespace internal |
| 461 } // namespace ash | 461 } // namespace ash |
| OLD | NEW |