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

Side by Side Diff: device/vr/vr_device.h

Issue 2505493004: Wired up vrdisplayactivate/deactivate (Closed)
Patch Set: Again with the upstream issues 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/android/gvr/gvr_device_provider.cc ('k') | device/vr/vr_device.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef DEVICE_VR_VR_DEVICE_H 5 #ifndef DEVICE_VR_VR_DEVICE_H
6 #define DEVICE_VR_VR_DEVICE_H 6 #define DEVICE_VR_VR_DEVICE_H
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "device/vr/vr_export.h" 9 #include "device/vr/vr_export.h"
10 #include "device/vr/vr_service.mojom.h" 10 #include "device/vr/vr_service.mojom.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 mojom::VRLayerBoundsPtr right_bounds) = 0; 42 mojom::VRLayerBoundsPtr right_bounds) = 0;
43 43
44 virtual void AddService(VRServiceImpl* service); 44 virtual void AddService(VRServiceImpl* service);
45 virtual void RemoveService(VRServiceImpl* service); 45 virtual void RemoveService(VRServiceImpl* service);
46 46
47 // TODO(shaobo.yan@intel.com): Checks should be done against VRDisplayImpl and 47 // TODO(shaobo.yan@intel.com): Checks should be done against VRDisplayImpl and
48 // the name should be considered. 48 // the name should be considered.
49 virtual bool IsAccessAllowed(VRServiceImpl* service); 49 virtual bool IsAccessAllowed(VRServiceImpl* service);
50 virtual bool IsPresentingService(VRServiceImpl* service); 50 virtual bool IsPresentingService(VRServiceImpl* service);
51 51
52 virtual void OnDisplayChanged(); 52 virtual void OnChanged();
53 virtual void OnExitPresent(); 53 virtual void OnExitPresent();
54 virtual void OnDisplayBlur(); 54 virtual void OnBlur();
55 virtual void OnDisplayFocus(); 55 virtual void OnFocus();
56 virtual void OnActivate(mojom::VRDisplayEventReason reason);
57 virtual void OnDeactivate(mojom::VRDisplayEventReason reason);
56 58
57 protected: 59 protected:
58 friend class VRDisplayImpl; 60 friend class VRDisplayImpl;
59 61
60 void SetPresentingService(VRServiceImpl* service); 62 void SetPresentingService(VRServiceImpl* service);
61 63
62 private: 64 private:
63 // Each Service have one VRDisplay with one VRDevice. 65 // Each Service have one VRDisplay with one VRDevice.
64 // TODO(shaobo.yan@intel.com): Since the VRDisplayImpl knows its VRServiceImpl 66 // TODO(shaobo.yan@intel.com): Since the VRDisplayImpl knows its VRServiceImpl
65 // we should 67 // we should
66 // only need to store the VRDisplayImpl. 68 // only need to store the VRDisplayImpl.
67 using DisplayClientMap = std::map<VRServiceImpl*, VRDisplayImpl*>; 69 using DisplayClientMap = std::map<VRServiceImpl*, VRDisplayImpl*>;
68 DisplayClientMap displays_; 70 DisplayClientMap displays_;
69 71
70 // TODO(shaobo.yan@intel.com): Should track presenting VRDisplayImpl instead. 72 // TODO(shaobo.yan@intel.com): Should track presenting VRDisplayImpl instead.
71 VRServiceImpl* presenting_service_; 73 VRServiceImpl* presenting_service_;
72 74
73 unsigned int id_; 75 unsigned int id_;
74 76
75 static unsigned int next_id_; 77 static unsigned int next_id_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(VRDevice); 79 DISALLOW_COPY_AND_ASSIGN(VRDevice);
78 }; 80 };
79 81
80 } // namespace device 82 } // namespace device
81 83
82 #endif // DEVICE_VR_VR_DEVICE_H 84 #endif // DEVICE_VR_VR_DEVICE_H
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.cc ('k') | device/vr/vr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698