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 25 matching lines...) Expand all Loading... |
36 void PlatformScreenStub::AddInterfaces(shell::InterfaceRegistry* registry) {} | 36 void PlatformScreenStub::AddInterfaces(shell::InterfaceRegistry* registry) {} |
37 | 37 |
38 void PlatformScreenStub::Init(PlatformScreenDelegate* delegate) { | 38 void PlatformScreenStub::Init(PlatformScreenDelegate* delegate) { |
39 DCHECK(delegate); | 39 DCHECK(delegate); |
40 delegate_ = delegate; | 40 delegate_ = delegate; |
41 base::ThreadTaskRunnerHandle::Get()->PostTask( | 41 base::ThreadTaskRunnerHandle::Get()->PostTask( |
42 FROM_HERE, base::Bind(&PlatformScreenStub::FixedSizeScreenConfiguration, | 42 FROM_HERE, base::Bind(&PlatformScreenStub::FixedSizeScreenConfiguration, |
43 weak_ptr_factory_.GetWeakPtr())); | 43 weak_ptr_factory_.GetWeakPtr())); |
44 } | 44 } |
45 | 45 |
| 46 void PlatformScreenStub::RequestCloseDisplay(int64_t display_id) { |
| 47 if (display_id == kDisplayId) { |
| 48 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 49 FROM_HERE, base::Bind(&PlatformScreenDelegate::OnDisplayRemoved, |
| 50 base::Unretained(delegate_), display_id)); |
| 51 } |
| 52 } |
| 53 |
46 int64_t PlatformScreenStub::GetPrimaryDisplayId() const { | 54 int64_t PlatformScreenStub::GetPrimaryDisplayId() const { |
47 return kDisplayId; | 55 return kDisplayId; |
48 } | 56 } |
49 | 57 |
50 } // namespace display | 58 } // namespace display |
OLD | NEW |