| 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_impl.h" | 5 #include "content/browser/geolocation/location_arbitrator_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const LocationArbitratorImpl::LocationUpdateCallback& callback, | 99 const LocationArbitratorImpl::LocationUpdateCallback& callback, |
| 100 AccessTokenStore* access_token_store, | 100 AccessTokenStore* access_token_store, |
| 101 GeolocationDelegate* delegate) | 101 GeolocationDelegate* delegate) |
| 102 : LocationArbitratorImpl(callback, delegate), | 102 : LocationArbitratorImpl(callback, delegate), |
| 103 cell_(nullptr), | 103 cell_(nullptr), |
| 104 gps_(nullptr), | 104 gps_(nullptr), |
| 105 access_token_store_(access_token_store) {} | 105 access_token_store_(access_token_store) {} |
| 106 | 106 |
| 107 base::Time GetTimeNow() const override { return GetTimeNowForTest(); } | 107 base::Time GetTimeNow() const override { return GetTimeNowForTest(); } |
| 108 | 108 |
| 109 AccessTokenStore* NewAccessTokenStore() override { | 109 scoped_refptr<AccessTokenStore> NewAccessTokenStore() override { |
| 110 return access_token_store_.get(); | 110 return access_token_store_; |
| 111 } | 111 } |
| 112 | 112 |
| 113 std::unique_ptr<LocationProvider> NewNetworkLocationProvider( | 113 std::unique_ptr<LocationProvider> NewNetworkLocationProvider( |
| 114 AccessTokenStore* access_token_store, | 114 AccessTokenStore* access_token_store, |
| 115 net::URLRequestContextGetter* context, | 115 net::URLRequestContextGetter* context, |
| 116 const GURL& url, | 116 const GURL& url, |
| 117 const base::string16& access_token) override { | 117 const base::string16& access_token) override { |
| 118 cell_ = new MockLocationProvider; | 118 cell_ = new MockLocationProvider; |
| 119 return base::WrapUnique(cell_); | 119 return base::WrapUnique(cell_); |
| 120 } | 120 } |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 437 |
| 438 // Advance the time a short while to simulate successive calls. | 438 // Advance the time a short while to simulate successive calls. |
| 439 AdvanceTimeNow(base::TimeDelta::FromMilliseconds(5)); | 439 AdvanceTimeNow(base::TimeDelta::FromMilliseconds(5)); |
| 440 | 440 |
| 441 // Update with a less accurate position to verify 240956. | 441 // Update with a less accurate position to verify 240956. |
| 442 SetPositionFix(cell(), 3, 139, 150); | 442 SetPositionFix(cell(), 3, 139, 150); |
| 443 CheckLastPositionInfo(3, 139, 150); | 443 CheckLastPositionInfo(3, 139, 150); |
| 444 } | 444 } |
| 445 | 445 |
| 446 } // namespace content | 446 } // namespace content |
| OLD | NEW |