| 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_stub.h" | 5 #include "services/ui/display/platform_screen_stub.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 PlatformScreenStub::~PlatformScreenStub() {} | 49 PlatformScreenStub::~PlatformScreenStub() {} |
| 50 | 50 |
| 51 void PlatformScreenStub::FixedSizeScreenConfiguration() { | 51 void PlatformScreenStub::FixedSizeScreenConfiguration() { |
| 52 delegate_->OnDisplayAdded(display_id_, display_metrics_); | 52 delegate_->OnDisplayAdded(display_id_, display_metrics_); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void PlatformScreenStub::AddInterfaces( | 55 void PlatformScreenStub::AddInterfaces( |
| 56 service_manager::InterfaceRegistry* registry) {} | 56 service_manager::InterfaceRegistry* registry) {} |
| 57 | 57 |
| 58 void PlatformScreenStub::Init(PlatformScreenDelegate* delegate) { | 58 void PlatformScreenStub::Init(PlatformScreenDelegate* delegate, |
| 59 WindowMode window_mode) { |
| 59 DCHECK(delegate); | 60 DCHECK(delegate); |
| 60 delegate_ = delegate; | 61 delegate_ = delegate; |
| 61 display_metrics_ = DefaultViewportMetrics(); | 62 display_metrics_ = DefaultViewportMetrics(); |
| 62 base::ThreadTaskRunnerHandle::Get()->PostTask( | 63 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 63 FROM_HERE, base::Bind(&PlatformScreenStub::FixedSizeScreenConfiguration, | 64 FROM_HERE, base::Bind(&PlatformScreenStub::FixedSizeScreenConfiguration, |
| 64 weak_ptr_factory_.GetWeakPtr())); | 65 weak_ptr_factory_.GetWeakPtr())); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void PlatformScreenStub::RequestCloseDisplay(int64_t display_id) { | 68 void PlatformScreenStub::RequestCloseDisplay(int64_t display_id) { |
| 68 if (display_id == display_id_) { | 69 if (display_id == display_id_) { |
| 69 base::ThreadTaskRunnerHandle::Get()->PostTask( | 70 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 70 FROM_HERE, base::Bind(&PlatformScreenDelegate::OnDisplayRemoved, | 71 FROM_HERE, base::Bind(&PlatformScreenDelegate::OnDisplayRemoved, |
| 71 base::Unretained(delegate_), display_id)); | 72 base::Unretained(delegate_), display_id)); |
| 72 } | 73 } |
| 73 } | 74 } |
| 74 | 75 |
| 75 int64_t PlatformScreenStub::GetPrimaryDisplayId() const { | 76 int64_t PlatformScreenStub::GetPrimaryDisplayId() const { |
| 76 return display_id_; | 77 return display_id_; |
| 77 } | 78 } |
| 78 | 79 |
| 79 } // namespace display | 80 } // namespace display |
| OLD | NEW |