| OLD | NEW |
| 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 void NotifyArbitratorPermissionGranted( | 25 void NotifyArbitratorPermissionGranted( |
| 26 const GURL& requesting_frame) { | 26 const GURL& requesting_frame) { |
| 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 28 GeolocationProvider::GetInstance()->OnPermissionGranted(requesting_frame); | 28 GeolocationProvider::GetInstance()->OnPermissionGranted(requesting_frame); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void SendGeolocationPermissionResponse( | 31 void SendGeolocationPermissionResponse( |
| 32 const GURL& requesting_frame, int render_process_id, int render_view_id, | 32 const GURL& requesting_frame, int render_process_id, int render_view_id, |
| 33 int bridge_id, bool allowed) { | 33 int bridge_id, bool allowed) { |
| 34 RenderViewHost* r = RenderViewHost::FromID(render_process_id, render_view_id); | 34 RenderViewHostImpl* r = RenderViewHostImpl::FromID( |
| 35 render_process_id, render_view_id); |
| 35 if (!r) | 36 if (!r) |
| 36 return; | 37 return; |
| 37 r->Send(new GeolocationMsg_PermissionSet(render_view_id, bridge_id, allowed)); | 38 r->Send(new GeolocationMsg_PermissionSet(render_view_id, bridge_id, allowed)); |
| 38 | 39 |
| 39 if (allowed) { | 40 if (allowed) { |
| 40 BrowserThread::PostTask( | 41 BrowserThread::PostTask( |
| 41 BrowserThread::IO, FROM_HERE, | 42 BrowserThread::IO, FROM_HERE, |
| 42 base::Bind(&NotifyArbitratorPermissionGranted, requesting_frame)); | 43 base::Bind(&NotifyArbitratorPermissionGranted, requesting_frame)); |
| 43 } | 44 } |
| 44 } | 45 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 205 } |
| 205 } // namespace | 206 } // namespace |
| 206 | 207 |
| 207 GeolocationDispatcherHost* GeolocationDispatcherHost::New( | 208 GeolocationDispatcherHost* GeolocationDispatcherHost::New( |
| 208 int render_process_id, | 209 int render_process_id, |
| 209 GeolocationPermissionContext* geolocation_permission_context) { | 210 GeolocationPermissionContext* geolocation_permission_context) { |
| 210 return new GeolocationDispatcherHostImpl( | 211 return new GeolocationDispatcherHostImpl( |
| 211 render_process_id, | 212 render_process_id, |
| 212 geolocation_permission_context); | 213 geolocation_permission_context); |
| 213 } | 214 } |
| OLD | NEW |