OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser_plugin/browser_plugin_geolocation_permission_c
ontext.h" | 5 #include "content/browser/browser_plugin/browser_plugin_geolocation_permission_c
ontext.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return; | 42 return; |
43 } | 43 } |
44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
45 | 45 |
46 // Note that callback.Run(true) allows geolocation access, callback.Run(false) | 46 // Note that callback.Run(true) allows geolocation access, callback.Run(false) |
47 // denies geolocation access. | 47 // denies geolocation access. |
48 // We need to go to the renderer to ask embedder's js if we are allowed to | 48 // We need to go to the renderer to ask embedder's js if we are allowed to |
49 // have geolocation access. | 49 // have geolocation access. |
50 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, | 50 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, |
51 render_view_id); | 51 render_view_id); |
52 DCHECK(rvh); | |
53 if (rvh) { | 52 if (rvh) { |
54 DCHECK(rvh->GetProcess()->IsGuest()); | 53 DCHECK(rvh->GetProcess()->IsGuest()); |
55 WebContentsImpl* guest_web_contents = | 54 WebContentsImpl* guest_web_contents = |
56 static_cast<WebContentsImpl*>(rvh->GetDelegate()->GetAsWebContents()); | 55 static_cast<WebContentsImpl*>(rvh->GetDelegate()->GetAsWebContents()); |
57 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest(); | 56 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest(); |
58 guest->AskEmbedderForGeolocationPermission(bridge_id, | 57 guest->AskEmbedderForGeolocationPermission(bridge_id, |
59 requesting_frame, | 58 requesting_frame, |
60 callback); | 59 callback); |
61 } | 60 } |
62 } | 61 } |
(...skipping 23 matching lines...) Expand all Loading... |
86 DCHECK(rvh->GetProcess()->IsGuest()); | 85 DCHECK(rvh->GetProcess()->IsGuest()); |
87 WebContentsImpl* guest_web_contents = | 86 WebContentsImpl* guest_web_contents = |
88 static_cast<WebContentsImpl*>(rvh->GetDelegate()->GetAsWebContents()); | 87 static_cast<WebContentsImpl*>(rvh->GetDelegate()->GetAsWebContents()); |
89 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest(); | 88 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest(); |
90 if (guest) | 89 if (guest) |
91 guest->CancelGeolocationRequest(bridge_id); | 90 guest->CancelGeolocationRequest(bridge_id); |
92 } | 91 } |
93 } | 92 } |
94 | 93 |
95 } // namespace content | 94 } // namespace content |
OLD | NEW |