| 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/system_display_api.h" | 5 #include "extensions/browser/api/system_display/system_display_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "extensions/browser/api/system_display/display_info_provider.h" | 10 #include "extensions/browser/api/system_display/display_info_provider.h" |
| 11 #include "extensions/common/api/system_display.h" | 11 #include "extensions/common/api/system_display.h" |
| 12 | 12 |
| 13 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "extensions/common/manifest_handlers/kiosk_mode_info.h" | 15 #include "extensions/common/manifest_handlers/kiosk_mode_info.h" |
| 16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace extensions { | 19 namespace extensions { |
| 20 | 20 |
| 21 using api::system_display::DisplayUnitInfo; | 21 using api::system_display::DisplayUnitInfo; |
| 22 | 22 |
| 23 namespace SetDisplayProperties = api::system_display::SetDisplayProperties; | 23 namespace SetDisplayProperties = api::system_display::SetDisplayProperties; |
| 24 | 24 |
| 25 typedef std::vector<linked_ptr<api::system_display::DisplayUnitInfo>> | |
| 26 DisplayInfo; | |
| 27 | |
| 28 bool SystemDisplayGetInfoFunction::RunSync() { | 25 bool SystemDisplayGetInfoFunction::RunSync() { |
| 29 DisplayInfo all_displays_info = | 26 DisplayInfo all_displays_info = |
| 30 DisplayInfoProvider::Get()->GetAllDisplaysInfo(); | 27 DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| 31 results_ = api::system_display::GetInfo::Results::Create(all_displays_info); | 28 results_ = api::system_display::GetInfo::Results::Create(all_displays_info); |
| 32 return true; | 29 return true; |
| 33 } | 30 } |
| 34 | 31 |
| 35 bool SystemDisplaySetDisplayPropertiesFunction::RunSync() { | 32 bool SystemDisplaySetDisplayPropertiesFunction::RunSync() { |
| 36 #if !defined(OS_CHROMEOS) | 33 #if !defined(OS_CHROMEOS) |
| 37 SetError("Function available only on ChromeOS."); | 34 SetError("Function available only on ChromeOS."); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 58 return false; | 55 return false; |
| 59 #else | 56 #else |
| 60 scoped_ptr<api::system_display::EnableUnifiedDesktop::Params> params( | 57 scoped_ptr<api::system_display::EnableUnifiedDesktop::Params> params( |
| 61 api::system_display::EnableUnifiedDesktop::Params::Create(*args_)); | 58 api::system_display::EnableUnifiedDesktop::Params::Create(*args_)); |
| 62 DisplayInfoProvider::Get()->EnableUnifiedDesktop(params->enabled); | 59 DisplayInfoProvider::Get()->EnableUnifiedDesktop(params->enabled); |
| 63 return true; | 60 return true; |
| 64 #endif | 61 #endif |
| 65 } | 62 } |
| 66 | 63 |
| 67 } // namespace extensions | 64 } // namespace extensions |
| OLD | NEW |