Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: device/vr/vr_service_impl.cc

Issue 2510993002: Notify VRDeviceProviders when there are pages listening for vrdisplayactivate (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/vr/vr_service_impl.h ('k') | third_party/WebKit/Source/modules/vr/NavigatorVR.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "device/vr/vr_service_impl.h" 5 #include "device/vr/vr_service_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "device/vr/vr_device.h" 10 #include "device/vr/vr_device.h"
11 #include "device/vr/vr_device_manager.h" 11 #include "device/vr/vr_device_manager.h"
12 12
13 namespace device { 13 namespace device {
14 14
15 VRServiceImpl::VRServiceImpl() {} 15 VRServiceImpl::VRServiceImpl() : listening_for_activate_(false) {}
16 16
17 VRServiceImpl::~VRServiceImpl() { 17 VRServiceImpl::~VRServiceImpl() {
18 RemoveFromDeviceManager(); 18 RemoveFromDeviceManager();
19 } 19 }
20 20
21 void VRServiceImpl::BindRequest( 21 void VRServiceImpl::BindRequest(
22 mojo::InterfaceRequest<mojom::VRService> request) { 22 mojo::InterfaceRequest<mojom::VRService> request) {
23 VRServiceImpl* service = new VRServiceImpl(); 23 VRServiceImpl* service = new VRServiceImpl();
24 service->Bind(std::move(request)); 24 service->Bind(std::move(request));
25 } 25 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 client_ = std::move(service_client); 60 client_ = std::move(service_client);
61 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); 61 VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
62 // Once a client has been connected AddService will force any VRDisplays to 62 // Once a client has been connected AddService will force any VRDisplays to
63 // send OnConnected to it so that it's populated with the currently active 63 // send OnConnected to it so that it's populated with the currently active
64 // displays. Thereafer it will stay up to date by virtue of listening for new 64 // displays. Thereafer it will stay up to date by virtue of listening for new
65 // connected events. 65 // connected events.
66 device_manager->AddService(this); 66 device_manager->AddService(this);
67 callback.Run(device_manager->GetNumberOfConnectedDevices()); 67 callback.Run(device_manager->GetNumberOfConnectedDevices());
68 } 68 }
69 69
70 void VRServiceImpl::SetListeningForActivate(bool listening) {
71 listening_for_activate_ = listening;
72 VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
73 device_manager->ListeningForActivateChanged(listening);
74 }
75
70 } // namespace device 76 } // namespace device
OLDNEW
« no previous file with comments | « device/vr/vr_service_impl.h ('k') | third_party/WebKit/Source/modules/vr/NavigatorVR.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698