| 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/test/display_manager_test_api.h" | 5 #include "ash/test/display_manager_test_api.h" |
| 6 | 6 |
| 7 #include <cstdarg> | 7 #include <cstdarg> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 DisplayInfoList CreateDisplayInfoListFromString( | 31 DisplayInfoList CreateDisplayInfoListFromString( |
| 32 const std::string specs, | 32 const std::string specs, |
| 33 DisplayManager* display_manager) { | 33 DisplayManager* display_manager) { |
| 34 DisplayInfoList display_info_list; | 34 DisplayInfoList display_info_list; |
| 35 std::vector<std::string> parts = base::SplitString( | 35 std::vector<std::string> parts = base::SplitString( |
| 36 specs, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 36 specs, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 37 size_t index = 0; | 37 size_t index = 0; |
| 38 | 38 |
| 39 display::DisplayList list = | 39 display::Displays list = |
| 40 display_manager->IsInUnifiedMode() | 40 display_manager->IsInUnifiedMode() |
| 41 ? display_manager->software_mirroring_display_list() | 41 ? display_manager->software_mirroring_display_list() |
| 42 : display_manager->active_display_list(); | 42 : display_manager->active_display_list(); |
| 43 | 43 |
| 44 for (std::vector<std::string>::const_iterator iter = parts.begin(); | 44 for (std::vector<std::string>::const_iterator iter = parts.begin(); |
| 45 iter != parts.end(); ++iter, ++index) { | 45 iter != parts.end(); ++iter, ++index) { |
| 46 int64_t id = (index < list.size()) ? list[index].id() | 46 int64_t id = (index < list.size()) ? list[index].id() |
| 47 : display::Display::kInvalidDisplayID; | 47 : display::Display::kInvalidDisplayID; |
| 48 display_info_list.push_back( | 48 display_info_list.push_back( |
| 49 display::ManagedDisplayInfo::CreateFromSpecWithID(*iter, id)); | 49 display::ManagedDisplayInfo::CreateFromSpecWithID(*iter, id)); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 for (size_t i = 0; i < count; i++) { | 198 for (size_t i = 0; i < count; i++) { |
| 199 int64_t id = va_arg(args, int64_t); | 199 int64_t id = va_arg(args, int64_t); |
| 200 list.push_back(id); | 200 list.push_back(id); |
| 201 } | 201 } |
| 202 display::SortDisplayIdList(&list); | 202 display::SortDisplayIdList(&list); |
| 203 return list; | 203 return list; |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace test | 206 } // namespace test |
| 207 } // namespace ash | 207 } // namespace ash |
| OLD | NEW |