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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context.cc

Issue 360773003: [Geolocation] Enable content settings write using permissions bubbles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/content_settings/permission_queue_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/geolocation_permission_context.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc
index ca97bfad53c30733a0bc396e44f5df521a127247..c28fcfe6b29c22292bcdccc7abd90ef94f97e8ff 100644
--- a/chrome/browser/geolocation/geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context.cc
@@ -34,6 +34,7 @@ class GeolocationPermissionRequest : public PermissionBubbleRequest {
const PermissionRequestID& id,
const GURL& requesting_frame,
bool user_gesture,
+ const GURL& embedder,
Michael van Ouwerkerk 2014/07/01 12:55:59 Nit: move this before user_gesture so it is paired
Greg Billock 2014/07/01 17:03:33 Done.
base::Callback<void(bool)> callback,
const std::string& display_languages);
virtual ~GeolocationPermissionRequest();
@@ -54,6 +55,7 @@ class GeolocationPermissionRequest : public PermissionBubbleRequest {
PermissionRequestID id_;
GURL requesting_frame_;
bool user_gesture_;
+ GURL embedder_;
base::Callback<void(bool)> callback_;
std::string display_languages_;
};
@@ -63,12 +65,14 @@ GeolocationPermissionRequest::GeolocationPermissionRequest(
const PermissionRequestID& id,
const GURL& requesting_frame,
bool user_gesture,
+ const GURL& embedder,
base::Callback<void(bool)> callback,
const std::string& display_languages)
: context_(context),
id_(id),
requesting_frame_(requesting_frame),
user_gesture_(user_gesture),
+ embedder_(embedder),
callback_(callback),
display_languages_(display_languages) {}
@@ -96,10 +100,14 @@ GURL GeolocationPermissionRequest::GetRequestingHostname() const {
}
void GeolocationPermissionRequest::PermissionGranted() {
+ context_->QueueController()->UpdateContentSetting(
+ requesting_frame_, embedder_, true);
context_->NotifyPermissionSet(id_, requesting_frame_, callback_, true);
}
void GeolocationPermissionRequest::PermissionDenied() {
+ context_->QueueController()->UpdateContentSetting(
+ requesting_frame_, embedder_, false);
context_->NotifyPermissionSet(id_, requesting_frame_, callback_, false);
}
@@ -214,7 +222,7 @@ void GeolocationPermissionContext::DecidePermission(
if (mgr) {
scoped_ptr<GeolocationPermissionRequest> request_ptr(
new GeolocationPermissionRequest(
- this, id, requesting_frame, user_gesture, callback,
+ this, id, requesting_frame, user_gesture, embedder, callback,
profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)));
GeolocationPermissionRequest* request = request_ptr.get();
pending_requests_.add(id.ToString(), request_ptr.Pass());
« no previous file with comments | « chrome/browser/content_settings/permission_queue_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698