Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java

Issue 2797903002: Geolocation Android: split LocationProviderAndroid out of LocationProviderFactory (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.device.geolocation; 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;
(...skipping 10 matching lines...) Expand all
21 * content/browser/geolocation/location_api_adapter_android.h. 21 * content/browser/geolocation/location_api_adapter_android.h.
22 * Based on android.webkit.GeolocationService.java 22 * Based on android.webkit.GeolocationService.java
23 */ 23 */
24 @MainDex 24 @MainDex
25 @VisibleForTesting 25 @VisibleForTesting
26 public class LocationProviderAdapter { 26 public class LocationProviderAdapter {
27 // Delegate handling the real work in the main thread. 27 // Delegate handling the real work in the main thread.
28 private LocationProviderFactory.LocationProvider mImpl; 28 private LocationProviderFactory.LocationProvider mImpl;
29 29
30 private LocationProviderAdapter(Context context) { 30 private LocationProviderAdapter(Context context) {
31 mImpl = LocationProviderFactory.get(context); 31 mImpl = LocationProviderFactory.create(context);
32 } 32 }
33 33
34 @CalledByNative 34 @CalledByNative
35 public static LocationProviderAdapter create(Context context) { 35 public static LocationProviderAdapter create(Context context) {
36 return new LocationProviderAdapter(context); 36 return new LocationProviderAdapter(context);
37 } 37 }
38 38
39 /** 39 /**
40 * Start listening for location updates until we're told to quit. May be cal led in any thread. 40 * Start listening for location updates until we're told to quit. May be cal led in any thread.
41 * @param enableHighAccuracy Whether or not to enable high accuracy location providers. 41 * @param enableHighAccuracy Whether or not to enable high accuracy location providers.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 public static void newErrorAvailable(String message) { 85 public static void newErrorAvailable(String message) {
86 nativeNewErrorAvailable(message); 86 nativeNewErrorAvailable(message);
87 } 87 }
88 88
89 // Native functions 89 // Native functions
90 private static native void nativeNewLocationAvailable(double latitude, doubl e longitude, 90 private static native void nativeNewLocationAvailable(double latitude, doubl e longitude,
91 double timeStamp, boolean hasAltitude, double altitude, boolean hasA ccuracy, 91 double timeStamp, boolean hasAltitude, double altitude, boolean hasA ccuracy,
92 double accuracy, boolean hasHeading, double heading, boolean hasSpee d, double speed); 92 double accuracy, boolean hasHeading, double heading, boolean hasSpee d, double speed);
93 private static native void nativeNewErrorAvailable(String message); 93 private static native void nativeNewErrorAvailable(String message);
94 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698