OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/browser/api/system_display/display_info_provider.h" | 5 #include "extensions/browser/api/system_display/display_info_provider.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "extensions/common/api/system_display.h" | 8 #include "extensions/common/api/system_display.h" |
9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 unit->work_area.left = work_area.x(); | 70 unit->work_area.left = work_area.x(); |
71 unit->work_area.top = work_area.y(); | 71 unit->work_area.top = work_area.y(); |
72 unit->work_area.width = work_area.width(); | 72 unit->work_area.width = work_area.width(); |
73 unit->work_area.height = work_area.height(); | 73 unit->work_area.height = work_area.height(); |
74 return unit; | 74 return unit; |
75 } | 75 } |
76 | 76 |
77 void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} | 77 void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} |
78 | 78 |
79 DisplayInfo DisplayInfoProvider::GetAllDisplaysInfo() { | 79 DisplayInfo DisplayInfoProvider::GetAllDisplaysInfo() { |
80 // TODO(scottmg): Native is wrong http://crbug.com/133312 | 80 gfx::Screen* screen = gfx::Screen::GetScreen(); |
81 gfx::Screen* screen = gfx::Screen::GetNativeScreen(); | |
82 int64_t primary_id = screen->GetPrimaryDisplay().id(); | 81 int64_t primary_id = screen->GetPrimaryDisplay().id(); |
83 std::vector<gfx::Display> displays = screen->GetAllDisplays(); | 82 std::vector<gfx::Display> displays = screen->GetAllDisplays(); |
84 DisplayInfo all_displays; | 83 DisplayInfo all_displays; |
85 for (const gfx::Display& display : displays) { | 84 for (const gfx::Display& display : displays) { |
86 linked_ptr<api::system_display::DisplayUnitInfo> unit( | 85 linked_ptr<api::system_display::DisplayUnitInfo> unit( |
87 CreateDisplayUnitInfo(display, primary_id)); | 86 CreateDisplayUnitInfo(display, primary_id)); |
88 UpdateDisplayUnitInfoForPlatform(display, unit.get()); | 87 UpdateDisplayUnitInfoForPlatform(display, unit.get()); |
89 all_displays.push_back(unit); | 88 all_displays.push_back(unit); |
90 } | 89 } |
91 return all_displays; | 90 return all_displays; |
92 } | 91 } |
93 | 92 |
94 DisplayInfoProvider::DisplayInfoProvider() { | 93 DisplayInfoProvider::DisplayInfoProvider() { |
95 } | 94 } |
96 | 95 |
97 } // namespace extensions | 96 } // namespace extensions |
OLD | NEW |