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

Side by Side Diff: ash/test/display_manager_test_api.cc

Issue 1130653004: Remove the removed display from the active list after displays are added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « ash/display/display_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/display_manager_test_api.h" 5 #include "ash/test/display_manager_test_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace { 28 namespace {
29 29
30 std::vector<DisplayInfo> CreateDisplayInfoListFromString( 30 std::vector<DisplayInfo> CreateDisplayInfoListFromString(
31 const std::string specs, 31 const std::string specs,
32 DisplayManager* display_manager) { 32 DisplayManager* display_manager) {
33 std::vector<DisplayInfo> display_info_list; 33 std::vector<DisplayInfo> display_info_list;
34 std::vector<std::string> parts; 34 std::vector<std::string> parts;
35 base::SplitString(specs, ',', &parts); 35 base::SplitString(specs, ',', &parts);
36 size_t index = 0; 36 size_t index = 0;
37
38 DisplayManager::DisplayList list =
39 display_manager->IsInUnifiedMode()
40 ? display_manager->software_mirroring_display_list()
41 : display_manager->active_display_list();
42
37 for (std::vector<std::string>::const_iterator iter = parts.begin(); 43 for (std::vector<std::string>::const_iterator iter = parts.begin();
38 iter != parts.end(); ++iter, ++index) { 44 iter != parts.end(); ++iter, ++index) {
39 int64 id = index < display_manager->GetNumDisplays() ? 45 int64 id = (index < list.size()) ? list[index].id()
40 display_manager->GetDisplayAt(index).id() : 46 : gfx::Display::kInvalidDisplayID;
41 gfx::Display::kInvalidDisplayID;
42 display_info_list.push_back( 47 display_info_list.push_back(
43 DisplayInfo::CreateFromSpecWithID(*iter, id)); 48 DisplayInfo::CreateFromSpecWithID(*iter, id));
44 } 49 }
45 return display_info_list; 50 return display_info_list;
46 } 51 }
47 52
48 } // namespace 53 } // namespace
49 54
50 // static 55 // static
51 bool DisplayManagerTestApi::TestIfMouseWarpsAt( 56 bool DisplayManagerTestApi::TestIfMouseWarpsAt(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 149
145 void DisplayManagerTestApi::SetAvailableColorProfiles( 150 void DisplayManagerTestApi::SetAvailableColorProfiles(
146 int64 display_id, 151 int64 display_id,
147 const std::vector<ui::ColorCalibrationProfile>& profiles) { 152 const std::vector<ui::ColorCalibrationProfile>& profiles) {
148 display_manager_->display_info_[display_id].set_available_color_profiles( 153 display_manager_->display_info_[display_id].set_available_color_profiles(
149 profiles); 154 profiles);
150 } 155 }
151 156
152 } // namespace test 157 } // namespace test
153 } // namespace ash 158 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698