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

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

Issue 1272823003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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.cc ('k') | base/command_line.cc » ('j') | 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/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_info.h" 10 #include "ash/display/display_info.h"
(...skipping 16 matching lines...) Expand all
27 typedef std::vector<gfx::Display> DisplayList; 27 typedef std::vector<gfx::Display> DisplayList;
28 typedef DisplayInfo DisplayInfo; 28 typedef DisplayInfo DisplayInfo;
29 typedef std::vector<DisplayInfo> DisplayInfoList; 29 typedef std::vector<DisplayInfo> DisplayInfoList;
30 30
31 namespace { 31 namespace {
32 32
33 std::vector<DisplayInfo> CreateDisplayInfoListFromString( 33 std::vector<DisplayInfo> CreateDisplayInfoListFromString(
34 const std::string specs, 34 const std::string specs,
35 DisplayManager* display_manager) { 35 DisplayManager* display_manager) {
36 std::vector<DisplayInfo> display_info_list; 36 std::vector<DisplayInfo> display_info_list;
37 std::vector<std::string> parts; 37 std::vector<std::string> parts = base::SplitString(
38 base::SplitString(specs, ',', &parts); 38 specs, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
39 size_t index = 0; 39 size_t index = 0;
40 40
41 DisplayManager::DisplayList list = 41 DisplayManager::DisplayList list =
42 display_manager->IsInUnifiedMode() 42 display_manager->IsInUnifiedMode()
43 ? display_manager->software_mirroring_display_list() 43 ? display_manager->software_mirroring_display_list()
44 : display_manager->active_display_list(); 44 : display_manager->active_display_list();
45 45
46 for (std::vector<std::string>::const_iterator iter = parts.begin(); 46 for (std::vector<std::string>::const_iterator iter = parts.begin();
47 iter != parts.end(); ++iter, ++index) { 47 iter != parts.end(); ++iter, ++index) {
48 int64 id = (index < list.size()) ? list[index].id() 48 int64 id = (index < list.size()) ? list[index].id()
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 159 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
160 const DisplayInfo& info = display_manager->GetDisplayInfo(display_id); 160 const DisplayInfo& info = display_manager->GetDisplayInfo(display_id);
161 DisplayMode mode; 161 DisplayMode mode;
162 if (!GetDisplayModeForResolution(info, resolution, &mode)) 162 if (!GetDisplayModeForResolution(info, resolution, &mode))
163 return false; 163 return false;
164 return display_manager->SetDisplayMode(display_id, mode); 164 return display_manager->SetDisplayMode(display_id, mode);
165 } 165 }
166 166
167 } // namespace test 167 } // namespace test
168 } // namespace ash 168 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_manager.cc ('k') | base/command_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698