| 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.device.geolocation; |
| 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 import org.chromium.base.annotations.MainDex; |
| 13 | 13 |
| 14 import java.util.concurrent.FutureTask; | 14 import java.util.concurrent.FutureTask; |
| 15 | 15 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 26 public class LocationProviderAdapter { | 26 public class LocationProviderAdapter { |
| 27 | 27 |
| 28 // Delegate handling the real work in the main thread. | 28 // Delegate handling the real work in the main thread. |
| 29 private LocationProviderFactory.LocationProvider mImpl; | 29 private LocationProviderFactory.LocationProvider mImpl; |
| 30 | 30 |
| 31 private LocationProviderAdapter(Context context) { | 31 private LocationProviderAdapter(Context context) { |
| 32 mImpl = LocationProviderFactory.get(context); | 32 mImpl = LocationProviderFactory.get(context); |
| 33 } | 33 } |
| 34 | 34 |
| 35 @CalledByNative | 35 @CalledByNative |
| 36 static LocationProviderAdapter create(Context context) { | 36 public static LocationProviderAdapter create(Context context) { |
| 37 return new LocationProviderAdapter(context); | 37 return new LocationProviderAdapter(context); |
| 38 } | 38 } |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Start listening for location updates until we're told to quit. May be cal
led in any thread. | 41 * Start listening for location updates until we're told to quit. May be cal
led in any thread. |
| 42 * @param enableHighAccuracy Whether or not to enable high accuracy location
providers. | 42 * @param enableHighAccuracy Whether or not to enable high accuracy location
providers. |
| 43 */ | 43 */ |
| 44 @CalledByNative | 44 @CalledByNative |
| 45 public boolean start(final boolean enableHighAccuracy) { | 45 public boolean start(final boolean enableHighAccuracy) { |
| 46 FutureTask<Void> task = new FutureTask<Void>(new Runnable() { | 46 FutureTask<Void> task = new FutureTask<Void>(new Runnable() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // Native functions | 92 // Native functions |
| 93 private static native void nativeNewLocationAvailable( | 93 private static native void nativeNewLocationAvailable( |
| 94 double latitude, double longitude, double timeStamp, | 94 double latitude, double longitude, double timeStamp, |
| 95 boolean hasAltitude, double altitude, | 95 boolean hasAltitude, double altitude, |
| 96 boolean hasAccuracy, double accuracy, | 96 boolean hasAccuracy, double accuracy, |
| 97 boolean hasHeading, double heading, | 97 boolean hasHeading, double heading, |
| 98 boolean hasSpeed, double speed); | 98 boolean hasSpeed, double speed); |
| 99 private static native void nativeNewErrorAvailable(String message); | 99 private static native void nativeNewErrorAvailable(String message); |
| 100 } | 100 } |
| OLD | NEW |