| 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_
|
|
|