| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/geolocation/geolocation_service_context.h" | 5 #include "device/geolocation/geolocation_service_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "device/geolocation/geolocation_service_impl.h" | 10 #include "device/geolocation/geolocation_service_impl.h" |
| 11 | 11 |
| 12 namespace device { | 12 namespace device { |
| 13 | 13 |
| 14 GeolocationServiceContext::GeolocationServiceContext() {} | 14 GeolocationServiceContext::GeolocationServiceContext() {} |
| 15 | 15 |
| 16 GeolocationServiceContext::~GeolocationServiceContext() {} | 16 GeolocationServiceContext::~GeolocationServiceContext() {} |
| 17 | 17 |
| 18 void GeolocationServiceContext::CreateService( | 18 void GeolocationServiceContext::CreateService( |
| 19 mojo::InterfaceRequest<mojom::GeolocationService> request) { | 19 const service_manager::BindSourceInfo& source_info, |
| 20 mojom::GeolocationServiceRequest request) { |
| 20 GeolocationServiceImpl* service = | 21 GeolocationServiceImpl* service = |
| 21 new GeolocationServiceImpl(std::move(request), this); | 22 new GeolocationServiceImpl(std::move(request), this); |
| 22 services_.push_back(base::WrapUnique<GeolocationServiceImpl>(service)); | 23 services_.push_back(base::WrapUnique<GeolocationServiceImpl>(service)); |
| 23 if (geoposition_override_) | 24 if (geoposition_override_) |
| 24 service->SetOverride(*geoposition_override_.get()); | 25 service->SetOverride(*geoposition_override_.get()); |
| 25 else | 26 else |
| 26 service->StartListeningForUpdates(); | 27 service->StartListeningForUpdates(); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void GeolocationServiceContext::ServiceHadConnectionError( | 30 void GeolocationServiceContext::ServiceHadConnectionError( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 } | 46 } |
| 46 } | 47 } |
| 47 | 48 |
| 48 void GeolocationServiceContext::ClearOverride() { | 49 void GeolocationServiceContext::ClearOverride() { |
| 49 for (auto& service : services_) { | 50 for (auto& service : services_) { |
| 50 service->ClearOverride(); | 51 service->ClearOverride(); |
| 51 } | 52 } |
| 52 } | 53 } |
| 53 | 54 |
| 54 } // namespace device | 55 } // namespace device |
| OLD | NEW |