| 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/display/display.h" | 9 #include "ui/display/display.h" | 
| 10 #include "ui/display/screen.h" | 10 #include "ui/display/screen.h" | 
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 66   unit.bounds.top = bounds.y(); | 66   unit.bounds.top = bounds.y(); | 
| 67   unit.bounds.width = bounds.width(); | 67   unit.bounds.width = bounds.width(); | 
| 68   unit.bounds.height = bounds.height(); | 68   unit.bounds.height = bounds.height(); | 
| 69   unit.work_area.left = work_area.x(); | 69   unit.work_area.left = work_area.x(); | 
| 70   unit.work_area.top = work_area.y(); | 70   unit.work_area.top = work_area.y(); | 
| 71   unit.work_area.width = work_area.width(); | 71   unit.work_area.width = work_area.width(); | 
| 72   unit.work_area.height = work_area.height(); | 72   unit.work_area.height = work_area.height(); | 
| 73   return unit; | 73   return unit; | 
| 74 } | 74 } | 
| 75 | 75 | 
|  | 76 bool DisplayInfoProvider::SetDisplayLayout(const DisplayLayoutList& layout) { | 
|  | 77   NOTREACHED();  // Implemented on Chrome OS only in override. | 
|  | 78   return false; | 
|  | 79 } | 
|  | 80 | 
| 76 void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} | 81 void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} | 
| 77 | 82 | 
| 78 DisplayUnitInfoList DisplayInfoProvider::GetAllDisplaysInfo() { | 83 DisplayInfoProvider::DisplayUnitInfoList | 
|  | 84 DisplayInfoProvider::GetAllDisplaysInfo() { | 
| 79   display::Screen* screen = display::Screen::GetScreen(); | 85   display::Screen* screen = display::Screen::GetScreen(); | 
| 80   int64_t primary_id = screen->GetPrimaryDisplay().id(); | 86   int64_t primary_id = screen->GetPrimaryDisplay().id(); | 
| 81   std::vector<display::Display> displays = screen->GetAllDisplays(); | 87   std::vector<display::Display> displays = screen->GetAllDisplays(); | 
| 82   DisplayUnitInfoList all_displays; | 88   DisplayUnitInfoList all_displays; | 
| 83   for (const display::Display& display : displays) { | 89   for (const display::Display& display : displays) { | 
| 84     api::system_display::DisplayUnitInfo unit = | 90     api::system_display::DisplayUnitInfo unit = | 
| 85         CreateDisplayUnitInfo(display, primary_id); | 91         CreateDisplayUnitInfo(display, primary_id); | 
| 86     UpdateDisplayUnitInfoForPlatform(display, &unit); | 92     UpdateDisplayUnitInfoForPlatform(display, &unit); | 
| 87     all_displays.push_back(std::move(unit)); | 93     all_displays.push_back(std::move(unit)); | 
| 88   } | 94   } | 
| 89   return all_displays; | 95   return all_displays; | 
| 90 } | 96 } | 
| 91 | 97 | 
|  | 98 DisplayInfoProvider::DisplayLayoutList DisplayInfoProvider::GetDisplayLayout() { | 
|  | 99   NOTREACHED();  // Implemented on Chrome OS only in override. | 
|  | 100   return DisplayLayoutList(); | 
|  | 101 } | 
|  | 102 | 
| 92 bool DisplayInfoProvider::OverscanCalibrationStart(const std::string& id) { | 103 bool DisplayInfoProvider::OverscanCalibrationStart(const std::string& id) { | 
| 93   return false; | 104   return false; | 
| 94 } | 105 } | 
| 95 | 106 | 
| 96 bool DisplayInfoProvider::OverscanCalibrationAdjust( | 107 bool DisplayInfoProvider::OverscanCalibrationAdjust( | 
| 97     const std::string& id, | 108     const std::string& id, | 
| 98     const api::system_display::Insets& delta) { | 109     const api::system_display::Insets& delta) { | 
| 99   return false; | 110   return false; | 
| 100 } | 111 } | 
| 101 | 112 | 
| 102 bool DisplayInfoProvider::OverscanCalibrationReset(const std::string& id) { | 113 bool DisplayInfoProvider::OverscanCalibrationReset(const std::string& id) { | 
| 103   return false; | 114   return false; | 
| 104 } | 115 } | 
| 105 | 116 | 
| 106 bool DisplayInfoProvider::OverscanCalibrationComplete(const std::string& id) { | 117 bool DisplayInfoProvider::OverscanCalibrationComplete(const std::string& id) { | 
| 107   return false; | 118   return false; | 
| 108 } | 119 } | 
| 109 | 120 | 
| 110 DisplayInfoProvider::DisplayInfoProvider() { | 121 DisplayInfoProvider::DisplayInfoProvider() { | 
| 111 } | 122 } | 
| 112 | 123 | 
| 113 }  // namespace extensions | 124 }  // namespace extensions | 
| OLD | NEW | 
|---|