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 "device/geolocation/geolocation_provider_impl.h" | 5 #include "device/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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 std::unique_ptr<LocationArbitrator> | 186 std::unique_ptr<LocationArbitrator> |
187 GeolocationProviderImpl::CreateArbitrator() { | 187 GeolocationProviderImpl::CreateArbitrator() { |
188 LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind( | 188 LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind( |
189 &GeolocationProviderImpl::OnLocationUpdate, base::Unretained(this)); | 189 &GeolocationProviderImpl::OnLocationUpdate, base::Unretained(this)); |
190 // Use the embedder's |g_delegate| or fall back to the default one. | 190 // Use the embedder's |g_delegate| or fall back to the default one. |
191 if (!g_delegate.Get()) | 191 if (!g_delegate.Get()) |
192 g_delegate.Get().reset(new GeolocationDelegate); | 192 g_delegate.Get().reset(new GeolocationDelegate); |
193 | 193 |
194 return base::WrapUnique( | 194 return base::MakeUnique<LocationArbitratorImpl>(callback, |
195 new LocationArbitratorImpl(callback, g_delegate.Get().get())); | 195 g_delegate.Get().get()); |
196 } | 196 } |
197 | 197 |
198 } // namespace device | 198 } // namespace device |
OLD | NEW |