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

Unified Diff: chrome/browser/android/location_settings.h

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 | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/location_settings_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/location_settings.h
diff --git a/chrome/browser/android/location_settings.h b/chrome/browser/android/location_settings.h
index 5d7fa7ec9c42059e31453f18fd37c1ab01fa0f2a..5dc407f1f6d6d6d79ca424d8790f4ddb9ac77b4c 100644
--- a/chrome/browser/android/location_settings.h
+++ b/chrome/browser/android/location_settings.h
@@ -5,7 +5,10 @@
#ifndef CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
#define CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
+#include "base/callback.h"
#include "base/macros.h"
+#include "components/location/android/location_settings_dialog_context.h"
+#include "components/location/android/location_settings_dialog_outcome.h"
namespace content {
class WebContents;
@@ -23,6 +26,34 @@ class LocationSettings {
// still has the ability to request the permissions to be granted.
virtual bool CanSitesRequestLocationPermission(
content::WebContents* web_contents) = 0;
+
+ // Returns true iff a prompt can be triggered to ask the user to turn on the
+ // system location setting on their device.
+ // 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.
+ virtual bool CanPromptToEnableSystemLocationSetting() = 0;
+
+ typedef base::OnceCallback<void(LocationSettingsDialogOutcome)>
+ LocationSettingsDialogOutcomeCallback;
+
+ // Triggers a prompt to ask the user to turn on the system location setting on
+ // their device, and returns the outcome of the prompt via a callback.
+ //
+ // The prompt will be triggered in the activity of the web contents.
+ //
+ // 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.
+ //
+ // The callback may be invoked a long time after this method has returned.
+ // If you need to access in the callback an object that is not owned by the
+ // callback, you should ensure that the object has not been destroyed before
+ // accessing it to prevent crashes, e.g. by using weak pointer semantics.
+ virtual void PromptToEnableSystemLocationSetting(
+ const LocationSettingsDialogContext prompt_context,
+ content::WebContents* web_contents,
+ LocationSettingsDialogOutcomeCallback callback) = 0;
};
#endif // CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/location_settings_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698