| 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 "content/browser/geolocation/geolocation_service_context.h" | 5 #include "content/browser/geolocation/geolocation_service_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 GeolocationServiceContext::GeolocationServiceContext() : paused_(false) { | 11 GeolocationServiceContext::GeolocationServiceContext() : paused_(false) { |
| 12 } | 12 } |
| 13 | 13 |
| 14 GeolocationServiceContext::~GeolocationServiceContext() { | 14 GeolocationServiceContext::~GeolocationServiceContext() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void GeolocationServiceContext::CreateService( | 17 void GeolocationServiceContext::CreateService( |
| 18 const base::Closure& update_callback, | 18 const base::Closure& update_callback, |
| 19 mojo::InterfaceRequest<mojom::GeolocationService> request) { | 19 mojo::InterfaceRequest<blink::mojom::GeolocationService> request) { |
| 20 GeolocationServiceImpl* service = | 20 GeolocationServiceImpl* service = |
| 21 new GeolocationServiceImpl(std::move(request), this, update_callback); | 21 new GeolocationServiceImpl(std::move(request), this, update_callback); |
| 22 services_.push_back(service); | 22 services_.push_back(service); |
| 23 if (geoposition_override_) | 23 if (geoposition_override_) |
| 24 service->SetOverride(*geoposition_override_.get()); | 24 service->SetOverride(*geoposition_override_.get()); |
| 25 else | 25 else |
| 26 service->StartListeningForUpdates(); | 26 service->StartListeningForUpdates(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void GeolocationServiceContext::ServiceHadConnectionError( | 29 void GeolocationServiceContext::ServiceHadConnectionError( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 void GeolocationServiceContext::ClearOverride() { | 58 void GeolocationServiceContext::ClearOverride() { |
| 59 for (auto* service : services_) { | 59 for (auto* service : services_) { |
| 60 service->ClearOverride(); | 60 service->ClearOverride(); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace content | 64 } // namespace content |
| OLD | NEW |