| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/display/platform_screen_impl.h" | 5 #include "services/ui/display/platform_screen_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace display { | 13 namespace display { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const int64_t kDisplayId = 1; |
| 17 |
| 16 void FixedSizeScreenConfiguration( | 18 void FixedSizeScreenConfiguration( |
| 17 const PlatformScreen::ConfiguredDisplayCallback& callback) { | 19 const PlatformScreen::ConfiguredDisplayCallback& callback) { |
| 18 callback.Run(1, gfx::Rect(1024, 768)); | 20 callback.Run(kDisplayId, gfx::Rect(1024, 768)); |
| 19 } | 21 } |
| 20 | 22 |
| 21 } // namespace | 23 } // namespace |
| 22 | 24 |
| 23 // static | 25 // static |
| 24 std::unique_ptr<PlatformScreen> PlatformScreen::Create() { | 26 std::unique_ptr<PlatformScreen> PlatformScreen::Create() { |
| 25 return base::WrapUnique(new PlatformScreenImpl); | 27 return base::WrapUnique(new PlatformScreenImpl); |
| 26 } | 28 } |
| 27 | 29 |
| 28 PlatformScreenImpl::PlatformScreenImpl() {} | 30 PlatformScreenImpl::PlatformScreenImpl() {} |
| 29 | 31 |
| 30 PlatformScreenImpl::~PlatformScreenImpl() {} | 32 PlatformScreenImpl::~PlatformScreenImpl() {} |
| 31 | 33 |
| 32 void PlatformScreenImpl::Init() {} | 34 void PlatformScreenImpl::Init() {} |
| 33 | 35 |
| 34 void PlatformScreenImpl::ConfigurePhysicalDisplay( | 36 void PlatformScreenImpl::ConfigurePhysicalDisplay( |
| 35 const PlatformScreen::ConfiguredDisplayCallback& callback) { | 37 const PlatformScreen::ConfiguredDisplayCallback& callback) { |
| 36 base::ThreadTaskRunnerHandle::Get()->PostTask( | 38 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 37 FROM_HERE, base::Bind(&FixedSizeScreenConfiguration, callback)); | 39 FROM_HERE, base::Bind(&FixedSizeScreenConfiguration, callback)); |
| 38 } | 40 } |
| 39 | 41 |
| 42 int64_t PlatformScreenImpl::GetPrimaryDisplayId() const { |
| 43 return kDisplayId; |
| 44 } |
| 45 |
| 40 } // namespace display | 46 } // namespace display |
| OLD | NEW |