Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Side by Side Diff: ash/display/multi_display_manager.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some new gfx::Screen additions Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698