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

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

Issue 23440030: GeolocationPermissionContext: only use origin from embedder url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test, some cleanup. Created 7 years, 3 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/geolocation/chrome_geolocation_permission_context_unittest.cc ('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_infobar_delegate.cc
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index 0d1e5aa8a63d2655dbc6db48bf58da1a7add66b9..69df39c3b4910e89c17fe7270111eb811fca1c2d 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -49,7 +49,7 @@ GeolocationInfoBarDelegate::GeolocationInfoBarDelegate(
: ConfirmInfoBarDelegate(infobar_service),
controller_(controller),
id_(id),
- requesting_frame_(requesting_frame),
+ requesting_frame_(requesting_frame.GetOrigin()),
contents_unique_id_(contents_unique_id),
display_languages_(display_languages) {
}
@@ -65,8 +65,8 @@ bool GeolocationInfoBarDelegate::Accept() {
void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
bool allowed) {
if (web_contents()) {
- controller_->OnPermissionSet(id_, requesting_frame_,
- web_contents()->GetURL(),
+ GURL embedder = web_contents()->GetLastCommittedURL().GetOrigin();
+ controller_->OnPermissionSet(id_, requesting_frame_, embedder,
update_content_setting, allowed);
}
}
@@ -96,7 +96,7 @@ bool GeolocationInfoBarDelegate::ShouldExpireInternal(
string16 GeolocationInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringFUTF16(IDS_GEOLOCATION_INFOBAR_QUESTION,
- net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_));
+ net::FormatUrl(requesting_frame_, display_languages_));
}
string16 GeolocationInfoBarDelegate::GetButtonLabel(
« no previous file with comments | « chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698