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

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

Issue 1320005: Adds GeolocationContentSettings on TabContents. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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: chrome/browser/geolocation/geolocation_permission_context.cc
===================================================================
--- chrome/browser/geolocation/geolocation_permission_context.cc (revision 42590)
+++ chrome/browser/geolocation/geolocation_permission_context.cc (working copy)
@@ -124,7 +124,8 @@
void GeolocationPermissionContext::SetPermission(
int render_process_id, int render_view_id, int bridge_id,
const GURL& requesting_frame, bool allowed) {
- NotifyPermissionSet(render_process_id, render_view_id, bridge_id, allowed);
+ NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
+ requesting_frame, allowed);
}
void GeolocationPermissionContext::RequestPermissionFromUI(
@@ -144,10 +145,11 @@
tab_util::GetTabContentsByID(render_process_id, render_view_id);
if (!tab_contents) {
// The tab may have gone away, or the request may not be from a tab at all.
- LOG(WARNING) << "Attempt to use geolocaiton tabless renderer: "
+ LOG(WARNING) << "Attempt to use geolocation tabless renderer: "
<< render_process_id << "," << render_view_id << "," << bridge_id
<< " (geolocation is not supported in extensions)";
- NotifyPermissionSet(render_process_id, render_view_id, bridge_id, false);
+ NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
+ requesting_frame, false);
return;
}
tab_contents->AddInfoBar(new GeolocationConfirmInfoBarDelegate(tab_contents,
@@ -155,17 +157,25 @@
}
void GeolocationPermissionContext::NotifyPermissionSet(
- int render_process_id, int render_view_id, int bridge_id, bool allowed) {
+ int render_process_id, int render_view_id, int bridge_id,
+ const GURL& requesting_frame, bool allowed) {
if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
ChromeThread::PostTask(
ChromeThread::UI, FROM_HERE,
NewRunnableMethod(this,
&GeolocationPermissionContext::NotifyPermissionSet,
- render_process_id, render_view_id, bridge_id, allowed));
+ render_process_id, render_view_id, bridge_id, requesting_frame,
+ allowed));
return;
}
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ RenderViewHostDelegate::Resource* resource =
+ tab_util::GetTabContentsByID(render_process_id, render_view_id);
+ // TabContents may have gone away (or not exists for extension).
+ if (resource)
+ resource->OnGeolocationPermissionSet(requesting_frame, allowed);
+
CallRenderViewHost(
render_process_id, render_view_id,
&RenderViewHost::Send,
« no previous file with comments | « chrome/browser/geolocation/geolocation_permission_context.h ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698