| Index: services/ui/display/platform_screen_impl.cc
|
| diff --git a/services/ui/display/platform_screen_impl.cc b/services/ui/display/platform_screen_impl.cc
|
| index 702906fbbc246d7161564e61462c7dce08e1f953..a721bc6374b13ca0b13a119ec23eee1d5c90f50b 100644
|
| --- a/services/ui/display/platform_screen_impl.cc
|
| +++ b/services/ui/display/platform_screen_impl.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "services/ui/display/platform_screen_impl.h"
|
|
|
| +#include <memory>
|
| +
|
| #include "base/bind.h"
|
| #include "base/location.h"
|
| #include "base/memory/ptr_util.h"
|
| @@ -15,28 +17,29 @@ namespace {
|
|
|
| const int64_t kDisplayId = 1;
|
|
|
| -void FixedSizeScreenConfiguration(
|
| - const PlatformScreen::ConfiguredDisplayCallback& callback) {
|
| - callback.Run(kDisplayId, gfx::Rect(1024, 768));
|
| -}
|
| -
|
| } // namespace
|
|
|
| // static
|
| std::unique_ptr<PlatformScreen> PlatformScreen::Create() {
|
| - return base::WrapUnique(new PlatformScreenImpl);
|
| + return base::MakeUnique<PlatformScreenImpl>();
|
| }
|
|
|
| -PlatformScreenImpl::PlatformScreenImpl() {}
|
| +PlatformScreenImpl::PlatformScreenImpl() : weak_ptr_factory_(this) {}
|
|
|
| PlatformScreenImpl::~PlatformScreenImpl() {}
|
|
|
| +void PlatformScreenImpl::FixedSizeScreenConfiguration() {
|
| + delegate_->OnDisplayAdded(this, kDisplayId, gfx::Rect(1024, 768));
|
| +}
|
| +
|
| void PlatformScreenImpl::Init() {}
|
|
|
| -void PlatformScreenImpl::ConfigurePhysicalDisplay(
|
| - const PlatformScreen::ConfiguredDisplayCallback& callback) {
|
| +void PlatformScreenImpl::ConfigureDisplays(PlatformScreenDelegate* delegate) {
|
| + DCHECK(delegate);
|
| + delegate_ = delegate;
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE, base::Bind(&FixedSizeScreenConfiguration, callback));
|
| + FROM_HERE, base::Bind(&PlatformScreenImpl::FixedSizeScreenConfiguration,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| int64_t PlatformScreenImpl::GetPrimaryDisplayId() const {
|
|
|