OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_web_contents_observer.h" | 5 #include "extensions/browser/extension_web_contents_observer.h" |
6 | 6 |
7 #include "content/public/browser/child_process_security_policy.h" | 7 #include "content/public/browser/child_process_security_policy.h" |
8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 if (!site.SchemeIs(kExtensionScheme)) | 265 if (!site.SchemeIs(kExtensionScheme)) |
266 return std::string(); | 266 return std::string(); |
267 | 267 |
268 return site.host(); | 268 return site.host(); |
269 } | 269 } |
270 | 270 |
271 void ExtensionWebContentsObserver::OnRequest( | 271 void ExtensionWebContentsObserver::OnRequest( |
272 content::RenderFrameHost* render_frame_host, | 272 content::RenderFrameHost* render_frame_host, |
273 const ExtensionHostMsg_Request_Params& params) { | 273 const ExtensionHostMsg_Request_Params& params) { |
274 dispatcher_.Dispatch(params, render_frame_host); | 274 dispatcher_.Dispatch(params, render_frame_host, |
| 275 render_frame_host->GetProcess()->GetID()); |
275 } | 276 } |
276 | 277 |
277 void ExtensionWebContentsObserver::InitializeFrameHelper( | 278 void ExtensionWebContentsObserver::InitializeFrameHelper( |
278 content::RenderFrameHost* render_frame_host) { | 279 content::RenderFrameHost* render_frame_host) { |
279 // Since this is called for all existing RenderFrameHosts during the | 280 // Since this is called for all existing RenderFrameHosts during the |
280 // ExtensionWebContentsObserver's creation, it's possible that not all hosts | 281 // ExtensionWebContentsObserver's creation, it's possible that not all hosts |
281 // are ready. | 282 // are ready. |
282 // We only initialize the frame if the renderer counterpart is live; otherwise | 283 // We only initialize the frame if the renderer counterpart is live; otherwise |
283 // we wait for the RenderFrameCreated notification. | 284 // we wait for the RenderFrameCreated notification. |
284 if (render_frame_host->IsRenderFrameLive()) | 285 if (render_frame_host->IsRenderFrameLive()) |
285 InitializeRenderFrame(render_frame_host); | 286 InitializeRenderFrame(render_frame_host); |
286 } | 287 } |
287 | 288 |
288 } // namespace extensions | 289 } // namespace extensions |
OLD | NEW |