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

Side by Side Diff: content/browser/geolocation/geolocation_dispatcher_host.cc

Issue 356543003: Audit the last usage of Geolocation and Notification permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up. Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/geolocation/geolocation_dispatcher_host.h" 5 #include "content/browser/geolocation/geolocation_dispatcher_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void GeolocationDispatcherHost::OnLocationUpdate( 123 void GeolocationDispatcherHost::OnLocationUpdate(
124 const Geoposition& geoposition) { 124 const Geoposition& geoposition) {
125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
126 126
127 RecordGeopositionErrorCode(geoposition.error_code); 127 RecordGeopositionErrorCode(geoposition.error_code);
128 if (paused_) 128 if (paused_)
129 return; 129 return;
130 130
131 for (std::map<RenderFrameHost*, bool>::iterator i = updating_frames_.begin(); 131 for (std::map<RenderFrameHost*, bool>::iterator i = updating_frames_.begin();
132 i != updating_frames_.end(); ++i) { 132 i != updating_frames_.end(); ++i) {
133 RenderFrameHost* topFrame = i->first;
jam 2014/07/14 18:20:53 nit: top_frame per style guide
Daniel Nishi 2014/07/14 22:25:05 Done.
134 while (topFrame->GetParent()) {
135 topFrame = topFrame->GetParent();
136 }
137 GetContentClient()->browser()->DidUseGeolocationPermission(
138 web_contents(),
139 i->first->GetLastCommittedURL().GetOrigin(),
140 topFrame->GetLastCommittedURL().GetOrigin());
141
133 i->first->Send(new GeolocationMsg_PositionUpdated( 142 i->first->Send(new GeolocationMsg_PositionUpdated(
134 i->first->GetRoutingID(), geoposition)); 143 i->first->GetRoutingID(), geoposition));
135 } 144 }
136 } 145 }
137 146
138 void GeolocationDispatcherHost::OnRequestPermission( 147 void GeolocationDispatcherHost::OnRequestPermission(
139 RenderFrameHost* render_frame_host, 148 RenderFrameHost* render_frame_host,
140 int bridge_id, 149 int bridge_id,
141 const GURL& requesting_frame, 150 const GURL& requesting_frame,
142 bool user_gesture) { 151 bool user_gesture) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 257
249 pending_permissions_.erase(pending_permissions_.begin() + i); 258 pending_permissions_.erase(pending_permissions_.begin() + i);
250 return; 259 return;
251 } 260 }
252 } 261 }
253 262
254 NOTREACHED(); 263 NOTREACHED();
255 } 264 }
256 265
257 } // namespace content 266 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698