Chromium Code Reviews| Index: services/ui/display/platform_screen_ozone.cc |
| diff --git a/services/ui/display/platform_screen_ozone.cc b/services/ui/display/platform_screen_ozone.cc |
| index 9bf16ebf652acc1fd742f056953328ff1a5b8d30..52aa4607f472b70d1244bc1d50212707476ce8d1 100644 |
| --- a/services/ui/display/platform_screen_ozone.cc |
| +++ b/services/ui/display/platform_screen_ozone.cc |
| @@ -5,11 +5,13 @@ |
| #include "services/ui/display/platform_screen_ozone.h" |
| #include <memory> |
| +#include <utility> |
| #include "base/command_line.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/sys_info.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "services/shell/public/cpp/interface_registry.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| #include "ui/display/types/display_constants.h" |
| #include "ui/display/types/display_snapshot.h" |
| @@ -36,6 +38,10 @@ PlatformScreenOzone::~PlatformScreenOzone() { |
| display_configurator_.RemoveObserver(this); |
| } |
| +void PlatformScreenOzone::AddInterfaces(shell::InterfaceRegistry* registry) { |
| + registry->AddInterface<mojom::DisplayController>(this); |
|
dcheng
2016/09/12 18:04:30
Does this have other InterfaceFactory superclasses
kylechar
2016/09/12 18:28:15
No other interface factory superclasses, so yep it
dcheng
2016/09/13 01:04:48
Ha, I forgot I was in favor of requiring this temp
sky
2016/09/13 02:07:40
AddInterface<ExplicitTemplateArg> is mildly less c
|
| +} |
| + |
| void PlatformScreenOzone::Init(PlatformScreenDelegate* delegate) { |
| DCHECK(delegate); |
| delegate_ = delegate; |
| @@ -64,22 +70,17 @@ int64_t PlatformScreenOzone::GetPrimaryDisplayId() const { |
| return primary_display_id_; |
| } |
| -void PlatformScreenOzone::ToggleVirtualDisplay( |
| - const ToggleVirtualDisplayCallback& callback) { |
| - if (base::SysInfo::IsRunningOnChromeOS()) { |
| - callback.Run(false); |
| +void PlatformScreenOzone::ToggleVirtualDisplay() { |
| + if (base::SysInfo::IsRunningOnChromeOS()) |
| return; |
| - } |
| + // TODO(kylechar): Convert to use VirtualDisplayDelegate once landed. |
| if (cached_displays_.size() == 1) { |
| display_configurator_.AddVirtualDisplay(cached_displays_[0].bounds.size()); |
| - callback.Run(true); |
| } else if (cached_displays_.size() > 1) { |
| - callback.Run( |
| - display_configurator_.RemoveVirtualDisplay(cached_displays_.back().id)); |
| + display_configurator_.RemoveVirtualDisplay(cached_displays_.back().id); |
| } else { |
| NOTREACHED(); |
| - callback.Run(false); |
| } |
| } |
| @@ -200,4 +201,9 @@ void PlatformScreenOzone::OnDisplayModeChangeFailed( |
| LOG(ERROR) << "OnDisplayModeChangeFailed from DisplayConfigurator"; |
| } |
| +void PlatformScreenOzone::Create(const shell::Identity& remote_identity, |
| + mojom::DisplayControllerRequest request) { |
| + bindings_.AddBinding(this, std::move(request)); |
| +} |
| + |
| } // namespace display |