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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java

Issue 2183563002: Remove Context param from LocationUtils methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update BT Device Fakes class Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java
index 970d9d8802478786012f617710055e61b855b146..7d45e0e1096a680b1cc6c1c530316eae908eda7e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java
@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.preferences;
import android.Manifest;
-import android.content.Context;
import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
@@ -28,14 +27,11 @@ public class LocationSettings {
private static LocationSettings sInstance;
- protected final Context mContext;
-
/**
* Don't use this; use getInstance() instead. This should be used only by the Application inside
* of createLocationSettings().
*/
- protected LocationSettings(Context context) {
- mContext = context;
+ protected LocationSettings() {
}
/**
@@ -58,12 +54,11 @@ public class LocationSettings {
if (cvc == null) return false;
WindowAndroid windowAndroid = cvc.getWindowAndroid();
if (windowAndroid == null) return false;
- Context context = windowAndroid.getApplicationContext();
LocationUtils locationUtils = LocationUtils.getInstance();
- if (!locationUtils.isSystemLocationSettingEnabled(context)) return false;
+ if (!locationUtils.isSystemLocationSettingEnabled()) return false;
- return locationUtils.hasAndroidLocationPermission(context)
+ return locationUtils.hasAndroidLocationPermission()
|| windowAndroid.canRequestPermission(Manifest.permission.ACCESS_FINE_LOCATION);
}
@@ -72,7 +67,7 @@ public class LocationSettings {
*/
public boolean areAllLocationSettingsEnabled() {
return isChromeLocationSettingEnabled()
- && LocationUtils.getInstance().isSystemLocationSettingEnabled(mContext);
+ && LocationUtils.getInstance().isSystemLocationSettingEnabled();
}
/**

Powered by Google App Engine
This is Rietveld 408576698