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.h" | 5 #include "content/browser/geolocation/geolocation_provider.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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "content/browser/geolocation/location_arbitrator.h" | 14 #include "content/browser/geolocation/location_arbitrator_impl.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 void GeolocationProvider::AddObserver(GeolocationObserver* observer, | 19 void GeolocationProvider::AddObserver(GeolocationObserver* observer, |
20 const GeolocationObserverOptions& update_options) { | 20 const GeolocationObserverOptions& update_options) { |
21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
22 observers_[observer] = update_options; | 22 observers_[observer] = update_options; |
23 OnClientsChanged(); | 23 OnClientsChanged(); |
24 if (position_.Validate() || | 24 if (position_.Validate() || |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 arbitrator_ = CreateArbitrator(); | 186 arbitrator_ = CreateArbitrator(); |
187 } | 187 } |
188 | 188 |
189 void GeolocationProvider::CleanUp() { | 189 void GeolocationProvider::CleanUp() { |
190 DCHECK(OnGeolocationThread()); | 190 DCHECK(OnGeolocationThread()); |
191 delete arbitrator_; | 191 delete arbitrator_; |
192 arbitrator_ = NULL; | 192 arbitrator_ = NULL; |
193 } | 193 } |
194 | 194 |
195 GeolocationArbitrator* GeolocationProvider::CreateArbitrator() { | 195 GeolocationArbitrator* GeolocationProvider::CreateArbitrator() { |
196 return new GeolocationArbitrator(this); | 196 return new GeolocationArbitratorImpl(this); |
197 } | 197 } |
198 | 198 |
199 } // namespace content | 199 } // namespace content |
OLD | NEW |