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