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

Side by Side Diff: chrome/browser/extensions/display_info_provider_chromeos.cc

Issue 2084673003: MD Settings: Add display layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_547080_display_settings6
Patch Set: Nit Created 4 years, 6 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 | chrome/browser/resources/settings/device_page/compiled_resources2.gyp » ('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 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 all_displays.push_back(std::move(unit)); 548 all_displays.push_back(std::move(unit));
549 } 549 }
550 return all_displays; 550 return all_displays;
551 } 551 }
552 552
553 DisplayInfoProvider::DisplayLayoutList 553 DisplayInfoProvider::DisplayLayoutList
554 DisplayInfoProviderChromeOS::GetDisplayLayout() { 554 DisplayInfoProviderChromeOS::GetDisplayLayout() {
555 ash::DisplayManager* display_manager = 555 ash::DisplayManager* display_manager =
556 ash::Shell::GetInstance()->display_manager(); 556 ash::Shell::GetInstance()->display_manager();
557 557
558 if (display_manager->num_connected_displays() < 2)
559 return DisplayInfoProvider::DisplayLayoutList();
560
558 display::Screen* screen = display::Screen::GetScreen(); 561 display::Screen* screen = display::Screen::GetScreen();
559 std::vector<display::Display> displays = screen->GetAllDisplays(); 562 std::vector<display::Display> displays = screen->GetAllDisplays();
560 563
561 DisplayLayoutList result; 564 DisplayLayoutList result;
562 for (const display::Display& display : displays) { 565 for (const display::Display& display : displays) {
563 const display::DisplayPlacement placement = 566 const display::DisplayPlacement placement =
564 display_manager->GetCurrentDisplayLayout().FindPlacementById( 567 display_manager->GetCurrentDisplayLayout().FindPlacementById(
565 display.id()); 568 display.id());
566 if (placement.display_id == display::Display::kInvalidDisplayID) 569 if (placement.display_id == display::Display::kInvalidDisplayID)
567 continue; 570 continue;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 return nullptr; 633 return nullptr;
631 return iter->second.get(); 634 return iter->second.get();
632 } 635 }
633 636
634 // static 637 // static
635 DisplayInfoProvider* DisplayInfoProvider::Create() { 638 DisplayInfoProvider* DisplayInfoProvider::Create() {
636 return new DisplayInfoProviderChromeOS(); 639 return new DisplayInfoProviderChromeOS();
637 } 640 }
638 641
639 } // namespace extensions 642 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/device_page/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698