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

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: Patch android Created 6 years, 8 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 e291b27a29b6a3233175f9f6503f75e8df96252a..dbf0f14800873bba51fdaec6cdb938e46d145dc5 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -112,10 +112,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"));
}
@@ -145,6 +147,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;
}
@@ -157,6 +160,7 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest {
virtual ~GeolocationRequest() {}
base::Callback<void(bool)> callback_;
int bridge_id_;
+ bool user_gesture_;
};
class BrowserPluginGuest::MediaRequest : public PermissionRequest {
@@ -1057,6 +1061,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,
@@ -1066,7 +1071,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) ==
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/geolocation/geolocation_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698