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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 185813004: [Geolocation] Attach user gesture indicator to permission request call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: plumb through Created 6 years, 9 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: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 7aba3982a206fbf16dcfaacf9d8de0406af51a5d..02bc5af9ee236c14ab5c90cd46db1291f06092fe 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -111,10 +111,12 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest {
public:
GeolocationRequest(const base::WeakPtr<BrowserPluginGuest>& guest,
GeolocationCallback callback,
- int bridge_id)
+ int bridge_id,
+ bool user_gesture)
: PermissionRequest(guest),
callback_(callback),
- bridge_id_(bridge_id) {
+ bridge_id_(bridge_id),
+ user_gesture_(user_gesture) {
RecordAction(
base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation"));
}
@@ -144,6 +146,7 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest {
// permission. Therefore we use an invalid |bridge_id|.
-1 /* bridge_id */,
web_contents->GetLastCommittedURL(),
+ user_gesture_,
geolocation_callback);
return;
}
@@ -156,6 +159,7 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest {
virtual ~GeolocationRequest() {}
base::Callback<void(bool)> callback_;
int bridge_id_;
+ bool user_gesture_;
};
class BrowserPluginGuest::MediaRequest : public PermissionRequest {
@@ -1052,6 +1056,7 @@ void BrowserPluginGuest::SetDelegate(BrowserPluginGuestDelegate* delegate) {
void BrowserPluginGuest::AskEmbedderForGeolocationPermission(
int bridge_id,
const GURL& requesting_frame,
+ bool user_gesture,
const GeolocationCallback& callback) {
base::DictionaryValue request_info;
request_info.Set(browser_plugin::kURL,
@@ -1061,7 +1066,8 @@ void BrowserPluginGuest::AskEmbedderForGeolocationPermission(
RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_GEOLOCATION,
new GeolocationRequest(weak_ptr_factory_.GetWeakPtr(),
callback,
- bridge_id),
+ bridge_id,
+ user_gesture),
request_info);
DCHECK(bridge_id_to_request_id_map_.find(bridge_id) ==

Powered by Google App Engine
This is Rietveld 408576698