| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 | 8 |
| 9 import org.chromium.base.ThreadUtils; | 9 import org.chromium.base.ThreadUtils; |
| 10 import org.chromium.base.VisibleForTesting; | 10 import org.chromium.base.VisibleForTesting; |
| 11 import org.chromium.base.annotations.CalledByNative; | 11 import org.chromium.base.annotations.CalledByNative; |
| 12 import org.chromium.base.annotations.MainDex; |
| 12 | 13 |
| 13 import java.util.concurrent.FutureTask; | 14 import java.util.concurrent.FutureTask; |
| 14 | 15 |
| 15 /** | 16 /** |
| 16 * Implements the Java side of LocationProviderAndroid. | 17 * Implements the Java side of LocationProviderAndroid. |
| 17 * Delegates all real functionality to the implementation | 18 * Delegates all real functionality to the implementation |
| 18 * returned from LocationProviderFactory. | 19 * returned from LocationProviderFactory. |
| 19 * See detailed documentation on | 20 * See detailed documentation on |
| 20 * content/browser/geolocation/android_location_api_adapter.h. | 21 * content/browser/geolocation/android_location_api_adapter.h. |
| 21 * Based on android.webkit.GeolocationService.java | 22 * Based on android.webkit.GeolocationService.java |
| 22 */ | 23 */ |
| 24 @MainDex |
| 23 @VisibleForTesting | 25 @VisibleForTesting |
| 24 public class LocationProviderAdapter { | 26 public class LocationProviderAdapter { |
| 25 | 27 |
| 26 // Delegate handling the real work in the main thread. | 28 // Delegate handling the real work in the main thread. |
| 27 private LocationProviderFactory.LocationProvider mImpl; | 29 private LocationProviderFactory.LocationProvider mImpl; |
| 28 | 30 |
| 29 private LocationProviderAdapter(Context context) { | 31 private LocationProviderAdapter(Context context) { |
| 30 mImpl = LocationProviderFactory.get(context); | 32 mImpl = LocationProviderFactory.get(context); |
| 31 } | 33 } |
| 32 | 34 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 92 |
| 91 // Native functions | 93 // Native functions |
| 92 private static native void nativeNewLocationAvailable( | 94 private static native void nativeNewLocationAvailable( |
| 93 double latitude, double longitude, double timeStamp, | 95 double latitude, double longitude, double timeStamp, |
| 94 boolean hasAltitude, double altitude, | 96 boolean hasAltitude, double altitude, |
| 95 boolean hasAccuracy, double accuracy, | 97 boolean hasAccuracy, double accuracy, |
| 96 boolean hasHeading, double heading, | 98 boolean hasHeading, double heading, |
| 97 boolean hasSpeed, double speed); | 99 boolean hasSpeed, double speed); |
| 98 private static native void nativeNewErrorAvailable(String message); | 100 private static native void nativeNewErrorAvailable(String message); |
| 99 } | 101 } |
| OLD | NEW |