OLD | NEW |
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 Loading... |
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 for (const std::string& part : base::SplitString( | 174 vector<string> parts; |
175 size_str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { | 175 base::SplitString(size_str, ',', &parts); |
176 info_list.push_back(DisplayInfo::CreateFromSpec(part)); | 176 for (vector<string>::const_iterator iter = parts.begin(); |
| 177 iter != parts.end(); ++iter) { |
| 178 info_list.push_back(DisplayInfo::CreateFromSpec(*iter)); |
177 info_list.back().set_native(true); | 179 info_list.back().set_native(true); |
178 } | 180 } |
179 MaybeInitInternalDisplay(&info_list[0]); | 181 MaybeInitInternalDisplay(&info_list[0]); |
180 if (info_list.size() > 1 && | 182 if (info_list.size() > 1 && |
181 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) { | 183 command_line->HasSwitch(switches::kAshEnableSoftwareMirroring)) { |
182 SetMultiDisplayMode(MIRRORING); | 184 SetMultiDisplayMode(MIRRORING); |
183 } | 185 } |
184 OnNativeDisplaysChanged(info_list); | 186 OnNativeDisplaysChanged(info_list); |
185 return true; | 187 return true; |
186 } | 188 } |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1401 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1400 secondary_display->UpdateWorkAreaFromInsets(insets); | 1402 secondary_display->UpdateWorkAreaFromInsets(insets); |
1401 } | 1403 } |
1402 | 1404 |
1403 void DisplayManager::RunPendingTasksForTest() { | 1405 void DisplayManager::RunPendingTasksForTest() { |
1404 if (!software_mirroring_display_list_.empty()) | 1406 if (!software_mirroring_display_list_.empty()) |
1405 base::RunLoop().RunUntilIdle(); | 1407 base::RunLoop().RunUntilIdle(); |
1406 } | 1408 } |
1407 | 1409 |
1408 } // namespace ash | 1410 } // namespace ash |
OLD | NEW |