OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/vr/vr_service_consumer.h" |
| 6 |
| 7 #include "content/browser/vr/vr_service.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 VRServiceConsumer::VRServiceConsumer() : registered_with_service_(false) { |
| 12 } |
| 13 |
| 14 VRServiceConsumer::~VRServiceConsumer() { |
| 15 if (registered_with_service_) { |
| 16 VRService::RemoveConsumer(this); |
| 17 } |
| 18 } |
| 19 |
| 20 VRService* VRServiceConsumer::GetServiceInstance() { |
| 21 if (!registered_with_service_) { |
| 22 VRService::AddConsumer(this); |
| 23 registered_with_service_ = true; |
| 24 } |
| 25 return VRService::GetInstance(); |
| 26 } |
| 27 |
| 28 } // namespace content |
OLD | NEW |