diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-06-19 11:58:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-19 19:00:11 +0000 |
commit | 6f42c2520140acb4f0e4bd24e597f974df5f8599 (patch) | |
tree | 46538c06ee7c7cea88050757f67c9ab90248dea2 /extensions/browser/extension_web_contents_observer.h | |
parent | 827f05ffa204e546b0b884e82f2831371c7e9c89 (diff) | |
download | chromium_src-6f42c2520140acb4f0e4bd24e597f974df5f8599.zip chromium_src-6f42c2520140acb4f0e4bd24e597f974df5f8599.tar.gz chromium_src-6f42c2520140acb4f0e4bd24e597f974df5f8599.tar.bz2 |
[Extensions OOPI] Move view type and window id registration to frames
Move the registration of ViewType and browser window id to ExtensionFrameHelper,
so that it will work with OOPI. Also move browser window id registration to a
single place (ChromeExtensionWebContentsObserver).
This also lets us move GetExtensionViews() from ExtensionHelper.
Also correct the RenderFrameHost listening in ExtensionWebContentsObserver.
Cleanup along the way: make a ScriptContext::IsLazyBackgroundPage() method.
BUG=455776
TBR=nasko@chromium.org (extension message rename)
Review URL: https://codereview.chromium.org/1185373008
Cr-Commit-Position: refs/heads/master@{#335314}
Diffstat (limited to 'extensions/browser/extension_web_contents_observer.h')
-rw-r--r-- | extensions/browser/extension_web_contents_observer.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/extensions/browser/extension_web_contents_observer.h b/extensions/browser/extension_web_contents_observer.h index 32e44c7..266c0bf 100644 --- a/extensions/browser/extension_web_contents_observer.h +++ b/extensions/browser/extension_web_contents_observer.h @@ -45,6 +45,11 @@ class ExtensionWebContentsObserver content::BrowserContext* browser_context() { return browser_context_; } + // Initializes a new render frame. Subclasses should invoke this + // implementation if extending. + virtual void InitializeRenderFrame( + content::RenderFrameHost* render_frame_host); + // ExtensionFunctionDispatcher::Delegate overrides. content::WebContents* GetAssociatedWebContents() const override; @@ -54,18 +59,12 @@ class ExtensionWebContentsObserver void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; + void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; // Subclasses should call this first before doing their own message handling. bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override; - // Per the documentation in WebContentsObserver, these two methods are - // appropriate to track the set of current RenderFrameHosts. - // NOTE: FrameDeleted() != RenderFrameDeleted(). - void FrameDeleted(content::RenderFrameHost* render_frame_host) override; - void RenderFrameHostChanged(content::RenderFrameHost* old_host, - content::RenderFrameHost* new_host) override; - // Per the documentation in WebContentsObserver, these two methods are invoked // when a Pepper plugin instance is attached/detached in the page DOM. void PepperInstanceCreated() override; @@ -75,9 +74,6 @@ class ExtensionWebContentsObserver // NULL if the render view host is not for a valid extension. const Extension* GetExtension(content::RenderViewHost* render_view_host); - // Updates ViewType for RenderViewHost based on GetViewType(web_contents()). - void NotifyRenderViewType(content::RenderViewHost* render_view_host); - // Returns the extension or app ID associated with a render view host. Returns // the empty string if the render view host is not for a valid extension. static std::string GetExtensionId(content::RenderViewHost* render_view_host); @@ -86,6 +82,10 @@ class ExtensionWebContentsObserver void OnRequest(content::RenderFrameHost* render_frame_host, const ExtensionHostMsg_Request_Params& params); + // A helper function for initializing render frames at the creation of the + // observer. + void InitializeFrameHelper(content::RenderFrameHost* render_frame_host); + // The BrowserContext associated with the WebContents being observed. content::BrowserContext* browser_context_; |