| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/geolocation/geolocation_service_context.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 GeolocationServiceContext::GeolocationServiceContext() : paused_(false) { |
| 10 } |
| 11 |
| 12 GeolocationServiceContext::~GeolocationServiceContext() { |
| 13 } |
| 14 |
| 15 void GeolocationServiceContext::CreateService( |
| 16 const base::Closure& update_callback, |
| 17 mojo::InterfaceRequest<GeolocationService> request) { |
| 18 GeolocationServiceImpl* service = |
| 19 new GeolocationServiceImpl(this, update_callback); |
| 20 services_.push_back(service); |
| 21 mojo::WeakBindToRequest(service, &request); |
| 22 } |
| 23 |
| 24 void GeolocationServiceContext::ServiceHadConnectionError( |
| 25 GeolocationServiceImpl* service) { |
| 26 auto it = std::find(services_.begin(), services_.end(), service); |
| 27 DCHECK(it != services_.end()); |
| 28 services_.erase(it); |
| 29 } |
| 30 |
| 31 void GeolocationServiceContext::PauseUpdates() { |
| 32 paused_ = true; |
| 33 for (auto* service : services_) { |
| 34 service->PauseUpdates(); |
| 35 } |
| 36 } |
| 37 |
| 38 void GeolocationServiceContext::ResumeUpdates() { |
| 39 paused_ = false; |
| 40 for (auto* service : services_) { |
| 41 service->ResumeUpdates(); |
| 42 } |
| 43 } |
| 44 |
| 45 } // namespace content |
| OLD | NEW |