| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/location_arbitrator.h" | 5 #include "content/browser/geolocation/location_arbitrator.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 void GeolocationArbitrator::DoStartProviders() { | 79 void GeolocationArbitrator::DoStartProviders() { |
| 80 for (ScopedVector<LocationProviderBase>::iterator i = providers_.begin(); | 80 for (ScopedVector<LocationProviderBase>::iterator i = providers_.begin(); |
| 81 i != providers_.end(); ++i) { | 81 i != providers_.end(); ++i) { |
| 82 (*i)->StartProvider(current_provider_options_.use_high_accuracy); | 82 (*i)->StartProvider(current_provider_options_.use_high_accuracy); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void GeolocationArbitrator::StopProviders() { | 86 void GeolocationArbitrator::StopProviders() { |
| 87 providers_.reset(); | 87 providers_.clear(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void GeolocationArbitrator::OnAccessTokenStoresLoaded( | 90 void GeolocationArbitrator::OnAccessTokenStoresLoaded( |
| 91 AccessTokenStore::AccessTokenSet access_token_set, | 91 AccessTokenStore::AccessTokenSet access_token_set, |
| 92 net::URLRequestContextGetter* context_getter) { | 92 net::URLRequestContextGetter* context_getter) { |
| 93 if (!providers_.empty()) { | 93 if (!providers_.empty()) { |
| 94 // A second StartProviders() call may have arrived before the first | 94 // A second StartProviders() call may have arrived before the first |
| 95 // completed. | 95 // completed. |
| 96 return; | 96 return; |
| 97 } | 97 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 bool GeolocationArbitrator::HasPermissionBeenGranted() const { | 164 bool GeolocationArbitrator::HasPermissionBeenGranted() const { |
| 165 return is_permission_granted_; | 165 return is_permission_granted_; |
| 166 } | 166 } |
| 167 | 167 |
| 168 void GeolocationArbitrator::SetDependencyFactoryForTest( | 168 void GeolocationArbitrator::SetDependencyFactoryForTest( |
| 169 GeolocationArbitratorDependencyFactory* dependency_factory) { | 169 GeolocationArbitratorDependencyFactory* dependency_factory) { |
| 170 g_dependency_factory_for_test = dependency_factory; | 170 g_dependency_factory_for_test = dependency_factory; |
| 171 } | 171 } |
| OLD | NEW |