 Chromium Code Reviews
 Chromium Code Reviews Issue 1150683007:
  [Extensions] Use document url (not top url) for tab-specific permissions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1150683007:
  [Extensions] Use document url (not top url) for tab-specific permissions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: extensions/browser/extension_web_contents_observer.cc | 
| diff --git a/extensions/browser/extension_web_contents_observer.cc b/extensions/browser/extension_web_contents_observer.cc | 
| index 04335a527b8531cb9c7e3aac456528117b7be9ad..c9c8174d3559a23284206ddf904f4501736f2bf9 100644 | 
| --- a/extensions/browser/extension_web_contents_observer.cc | 
| +++ b/extensions/browser/extension_web_contents_observer.cc | 
| @@ -142,10 +142,19 @@ void ExtensionWebContentsObserver::RenderFrameHostChanged( | 
| if (old_host) | 
| process_manager->UnregisterRenderFrameHost(old_host); | 
| - const Extension* extension = GetExtension(new_host->GetRenderViewHost()); | 
| - if (extension) { | 
| + const Extension* frame_extension = GetExtensionForRenderFrame(new_host); | 
| + if (frame_extension) { | 
| process_manager->RegisterRenderFrameHost( | 
| - web_contents(), new_host, extension); | 
| + web_contents(), new_host, frame_extension); | 
| + } | 
| + | 
| + // This can be different from |frame_extension| above in the case of, e.g., | 
| + // a non-extension iframe hosted in a chrome-extension:// page. | 
| + const Extension* tab_extension = | 
| + GetExtensionForRenderFrame(web_contents()->GetMainFrame()); | 
| + if (tab_extension) { | 
| + new_host->Send(new ExtensionMsg_SetTabExtensionOwner( | 
| 
not at google - send to devlin
2015/06/03 20:15:44
creis/nasko -
Firstly, this is basically a side c
 
Devlin
2015/06/03 20:28:47
A bit more background - we prevent script injectio
 
nasko
2015/06/03 20:31:56
It isn't obvious to me that you are sending the UR
 
Devlin
2015/06/03 21:07:42
If (and only if) this is an extension page (i.e, a
 
Charlie Reis
2015/06/03 21:12:03
I don't have the full context here, but we do alre
 
Devlin
2015/06/03 21:23:51
Now I'm out of context. :)  Looking at FrameReplic
 
Charlie Reis
2015/06/03 21:34:42
No, it exists on RenderFrameProxy as well, so you
 | 
| + new_host->GetRoutingID(), tab_extension->id())); | 
| } | 
| } |