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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_android.h

Issue 2721293002: Show the Android Location Settings Dialog when sites want permission. (Closed)
Patch Set: Feedback 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
Index: chrome/browser/geolocation/geolocation_permission_context_android.h
diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.h b/chrome/browser/geolocation/geolocation_permission_context_android.h
index a739df65e7e2b0e3cd878b3686451b9142f860b5..146c16303cfc6ea5cef1e634a23c5e70ff79276b 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/geolocation_permission_context_android.h
@@ -24,7 +24,10 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/android/location_settings.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
+#include "components/location/android/location_settings_dialog_context.h"
+#include "components/location/android/location_settings_dialog_outcome.h"
namespace content {
class WebContents;
@@ -34,7 +37,6 @@ namespace infobars {
class InfoBar;
}
-class LocationSettings;
class GURL;
class PermissionRequestID;
@@ -69,12 +71,42 @@ class GeolocationPermissionContextAndroid
bool persist,
ContentSetting content_setting) override;
+ bool IsLocationAccessPossible(content::WebContents* web_contents,
+ const GURL& requesting_origin,
+ bool user_gesture);
+
+ LocationSettingsDialogContext GetLocationSettingsDialogContext(
+ const GURL& requesting_origin);
+
void HandleUpdateAndroidPermissions(const PermissionRequestID& id,
const GURL& requesting_frame_origin,
const GURL& embedding_origin,
const BrowserPermissionCallback& callback,
bool permissions_updated);
+ // Will return true if the location settings dialog will be shown for the
+ // given origins. This is true if the location setting is off, the dialog can
+ // be shown, any gesture requirements for the origin are met, and the dialog
+ // is not being suppressed for backoff.
+ bool CanShowLocationSettingsDialog(const GURL& requesting_origin,
+ bool user_gesture);
+
+ void OnLocationSettingsDialogShown(
+ const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ const GURL& embedding_origin,
+ const BrowserPermissionCallback& callback,
+ bool persist,
+ ContentSetting content_setting,
+ LocationSettingsDialogOutcome prompt_outcome);
+
+ void FinishNotifyPermissionSet(const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ const GURL& embedding_origin,
+ const BrowserPermissionCallback& callback,
+ bool persist,
+ ContentSetting content_setting);
+
// Overrides the LocationSettings object used to determine whether
// system and Chrome-wide location permissions are enabled.
void SetLocationSettingsForTesting(

Powered by Google App Engine
This is Rietveld 408576698