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

Unified Diff: components/location/android/java/src/org/chromium/components/location/LocationUtils.java

Issue 2709883005: Stubs for triggering the LSD in Clank (Closed)
Patch Set: Group location settings dialog enums into a single java_cpp_enum rule Created 3 years, 10 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
« no previous file with comments | « components/location/android/DEPS ('k') | components/location/android/location_settings_dialog_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/location/android/java/src/org/chromium/components/location/LocationUtils.java
diff --git a/components/location/android/java/src/org/chromium/components/location/LocationUtils.java b/components/location/android/java/src/org/chromium/components/location/LocationUtils.java
index 204a45abbfa61675a6bc845b0b127aa02ce5bf57..44055ef79424c3599d9a7790dd7645610a6e9d74 100644
--- a/components/location/android/java/src/org/chromium/components/location/LocationUtils.java
+++ b/components/location/android/java/src/org/chromium/components/location/LocationUtils.java
@@ -14,10 +14,14 @@ import android.provider.Settings;
import android.text.TextUtils;
import org.chromium.base.ApiCompatibilityUtils;
+import org.chromium.base.Callback;
import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.components.location.LocationSettingsDialogContext.LocationSettingsDialogContextEnum;
+import org.chromium.components.location.LocationSettingsDialogOutcome.LocationSettingsDialogOutcomeEnum;
+import org.chromium.ui.base.WindowAndroid;
/**
* Provides methods for querying Chrome's ability to use Android's location services.
@@ -83,6 +87,31 @@ public class LocationUtils {
}
/**
+ * Returns true iff a prompt can be triggered to ask the user to turn on the system location
+ * setting on their device.
+ *
+ * <p>In particular, returns false if the system location setting is already enabled or if some
+ * of the features required to trigger a system location setting prompt are not available.
+ */
+ public boolean canPromptToEnableSystemLocationSetting() {
+ return false;
+ }
+
+ /**
+ * Triggers a prompt to ask the user to turn on the system location setting on their device.
+ *
+ * <p>The prompt will be triggered within the specified window.
+ *
+ * <p>The callback is guaranteed to be called unless the user never replies to the prompt
+ * dialog, which in practice happens very infrequently since the dialog is modal.
+ */
+ public void promptToEnableSystemLocationSetting(
+ @LocationSettingsDialogContextEnum int promptContext, WindowAndroid window,
+ @LocationSettingsDialogOutcomeEnum Callback<Integer> callback) {
+ callback.onResult(LocationSettingsDialogOutcome.NO_PROMPT);
+ }
+
+ /**
* Returns an intent to launch Android Location Settings.
*/
public Intent getSystemLocationSettingsIntent() {
« no previous file with comments | « components/location/android/DEPS ('k') | components/location/android/location_settings_dialog_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698