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

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

Issue 1274123003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no media changes 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 | « no previous file | ash/test/display_manager_test_api.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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 #endif 164 #endif
165 } 165 }
166 166
167 bool DisplayManager::InitFromCommandLine() { 167 bool DisplayManager::InitFromCommandLine() {
168 DisplayInfoList info_list; 168 DisplayInfoList info_list;
169 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 169 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
170 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) 170 if (!command_line->HasSwitch(switches::kAshHostWindowBounds))
171 return false; 171 return false;
172 const string size_str = 172 const string size_str =
173 command_line->GetSwitchValueASCII(switches::kAshHostWindowBounds); 173 command_line->GetSwitchValueASCII(switches::kAshHostWindowBounds);
174 vector<string> parts; 174 for (const std::string& part : base::SplitString(
175 base::SplitString(size_str, ',', &parts); 175 size_str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
176 for (vector<string>::const_iterator iter = parts.begin(); 176 info_list.push_back(DisplayInfo::CreateFromSpec(part));
177 iter != parts.end(); ++iter) {
178 info_list.push_back(DisplayInfo::CreateFromSpec(*iter));
179 info_list.back().set_native(true); 177 info_list.back().set_native(true);
180 } 178 }
181 MaybeInitInternalDisplay(&info_list[0]); 179 MaybeInitInternalDisplay(&info_list[0]);
182 if (info_list.size() > 1 && 180 if (info_list.size() > 1 &&
183 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) { 181 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) {
184 SetMultiDisplayMode(MIRRORING); 182 SetMultiDisplayMode(MIRRORING);
185 } 183 }
186 OnNativeDisplaysChanged(info_list); 184 OnNativeDisplaysChanged(info_list);
187 return true; 185 return true;
188 } 186 }
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1399 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1402 secondary_display->UpdateWorkAreaFromInsets(insets); 1400 secondary_display->UpdateWorkAreaFromInsets(insets);
1403 } 1401 }
1404 1402
1405 void DisplayManager::RunPendingTasksForTest() { 1403 void DisplayManager::RunPendingTasksForTest() {
1406 if (!software_mirroring_display_list_.empty()) 1404 if (!software_mirroring_display_list_.empty())
1407 base::RunLoop().RunUntilIdle(); 1405 base::RunLoop().RunUntilIdle();
1408 } 1406 }
1409 1407
1410 } // namespace ash 1408 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/test/display_manager_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698