| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/display_info_provider_chromeos.h" | 5 #include "chrome/browser/extensions/display_info_provider_chromeos.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "ash/display/display_configuration_controller.h" | 9 #include "ash/display/display_configuration_controller.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 return DisplayInfoProvider::GetAllDisplaysInfo(); | 401 return DisplayInfoProvider::GetAllDisplaysInfo(); |
| 402 | 402 |
| 403 std::vector<gfx::Display> displays = | 403 std::vector<gfx::Display> displays = |
| 404 display_manager->software_mirroring_display_list(); | 404 display_manager->software_mirroring_display_list(); |
| 405 CHECK_GT(displays.size(), 0u); | 405 CHECK_GT(displays.size(), 0u); |
| 406 | 406 |
| 407 // Use first display as primary. | 407 // Use first display as primary. |
| 408 int64_t primary_id = displays[0].id(); | 408 int64_t primary_id = displays[0].id(); |
| 409 DisplayInfo all_displays; | 409 DisplayInfo all_displays; |
| 410 for (const gfx::Display& display : displays) { | 410 for (const gfx::Display& display : displays) { |
| 411 linked_ptr<api::system_display::DisplayUnitInfo> unit( | 411 api::system_display::DisplayUnitInfo unit = |
| 412 CreateDisplayUnitInfo(display, primary_id)); | 412 CreateDisplayUnitInfo(display, primary_id); |
| 413 UpdateDisplayUnitInfoForPlatform(display, unit.get()); | 413 UpdateDisplayUnitInfoForPlatform(display, &unit); |
| 414 all_displays.push_back(unit); | 414 all_displays.push_back(std::move(unit)); |
| 415 } | 415 } |
| 416 return all_displays; | 416 return all_displays; |
| 417 } | 417 } |
| 418 | 418 |
| 419 // static | 419 // static |
| 420 DisplayInfoProvider* DisplayInfoProvider::Create() { | 420 DisplayInfoProvider* DisplayInfoProvider::Create() { |
| 421 return new DisplayInfoProviderChromeOS(); | 421 return new DisplayInfoProviderChromeOS(); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace extensions | 424 } // namespace extensions |
| OLD | NEW |