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

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: tidy 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 new_displays = updated_displays; 181 new_displays = updated_displays;
182 } 182 }
183 183
184 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); 184 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor());
185 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); 185 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor());
186 DisplayList removed_displays; 186 DisplayList removed_displays;
187 std::vector<size_t> changed_display_indices; 187 std::vector<size_t> changed_display_indices;
188 std::vector<size_t> added_display_indices; 188 std::vector<size_t> added_display_indices;
189 gfx::Display current_primary; 189 gfx::Display current_primary;
190 if (Shell::HasInstance()) 190 if (Shell::HasInstance())
191 current_primary = gfx::Screen::GetPrimaryDisplay(); 191 current_primary = gfx::Screen::GetPrimaryDisplay(
192 ash::Shell::GetRootNativeView());
192 193
193 for (DisplayList::iterator curr_iter = displays_.begin(), 194 for (DisplayList::iterator curr_iter = displays_.begin(),
194 new_iter = new_displays.begin(); 195 new_iter = new_displays.begin();
195 curr_iter != displays_.end() || new_iter != new_displays.end();) { 196 curr_iter != displays_.end() || new_iter != new_displays.end();) {
196 if (curr_iter == displays_.end()) { 197 if (curr_iter == displays_.end()) {
197 // more displays in new list. 198 // more displays in new list.
198 added_display_indices.push_back(new_iter - new_displays.begin()); 199 added_display_indices.push_back(new_iter - new_displays.begin());
199 ++new_iter; 200 ++new_iter;
200 } else if (new_iter == new_displays.end()) { 201 } else if (new_iter == new_displays.end()) {
201 // more displays in current list. 202 // more displays in current list.
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 DisplayList::iterator iter_to_update = to_update->begin(); 436 DisplayList::iterator iter_to_update = to_update->begin();
436 DisplayList::const_iterator iter = displays_.begin(); 437 DisplayList::const_iterator iter = displays_.begin();
437 for (; iter != displays_.end() && iter_to_update != to_update->end(); 438 for (; iter != displays_.end() && iter_to_update != to_update->end();
438 ++iter, ++iter_to_update) { 439 ++iter, ++iter_to_update) {
439 (*iter_to_update).set_id((*iter).id()); 440 (*iter_to_update).set_id((*iter).id());
440 } 441 }
441 } 442 }
442 443
443 } // namespace internal 444 } // namespace internal
444 } // namespace ash 445 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698