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/geolocation_provider_impl.h" | 5 #include "content/browser/geolocation/geolocation_provider_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (ignore_location_updates_) | 61 if (ignore_location_updates_) |
62 return; | 62 return; |
63 BrowserThread::PostTask(BrowserThread::UI, | 63 BrowserThread::PostTask(BrowserThread::UI, |
64 FROM_HERE, | 64 FROM_HERE, |
65 base::Bind(&GeolocationProviderImpl::NotifyClients, | 65 base::Bind(&GeolocationProviderImpl::NotifyClients, |
66 base::Unretained(this), position)); | 66 base::Unretained(this), position)); |
67 } | 67 } |
68 | 68 |
69 GeolocationProviderImpl* GeolocationProviderImpl::GetInstance() { | 69 GeolocationProviderImpl* GeolocationProviderImpl::GetInstance() { |
70 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 70 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
71 return Singleton<GeolocationProviderImpl>::get(); | 71 return base::Singleton<GeolocationProviderImpl>::get(); |
72 } | 72 } |
73 | 73 |
74 GeolocationProviderImpl::GeolocationProviderImpl() | 74 GeolocationProviderImpl::GeolocationProviderImpl() |
75 : base::Thread("Geolocation"), | 75 : base::Thread("Geolocation"), |
76 user_did_opt_into_location_services_(false), | 76 user_did_opt_into_location_services_(false), |
77 ignore_location_updates_(false), | 77 ignore_location_updates_(false), |
78 arbitrator_(NULL) { | 78 arbitrator_(NULL) { |
79 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 79 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
80 high_accuracy_callbacks_.set_removal_callback( | 80 high_accuracy_callbacks_.set_removal_callback( |
81 base::Bind(&GeolocationProviderImpl::OnClientsChanged, | 81 base::Bind(&GeolocationProviderImpl::OnClientsChanged, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 arbitrator_ = NULL; | 171 arbitrator_ = NULL; |
172 } | 172 } |
173 | 173 |
174 LocationArbitrator* GeolocationProviderImpl::CreateArbitrator() { | 174 LocationArbitrator* GeolocationProviderImpl::CreateArbitrator() { |
175 LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind( | 175 LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind( |
176 &GeolocationProviderImpl::OnLocationUpdate, base::Unretained(this)); | 176 &GeolocationProviderImpl::OnLocationUpdate, base::Unretained(this)); |
177 return new LocationArbitratorImpl(callback); | 177 return new LocationArbitratorImpl(callback); |
178 } | 178 } |
179 | 179 |
180 } // namespace content | 180 } // namespace content |
OLD | NEW |