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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_
6 #define EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/renderer/content_renderer_client.h"
13 namespace extensions {
16 class DispatcherDelegate;
17 class ShellExtensionsClient;
18 class ShellExtensionsRendererClient;
19 class ShellRendererMainDelegate;
21 // Renderer initialization and runtime support for app_shell.
22 class ShellContentRendererClient : public content::ContentRendererClient {
24 ShellContentRendererClient();
25 virtual ~ShellContentRendererClient();
27 // content::ContentRendererClient implementation:
28 virtual void RenderThreadStarted() OVERRIDE;
29 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE;
30 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE;
31 virtual bool OverrideCreatePlugin(content::RenderFrame* render_frame,
32 blink::WebLocalFrame* frame,
33 const blink::WebPluginParams& params,
34 blink::WebPlugin** plugin) OVERRIDE;
35 virtual blink::WebPlugin* CreatePluginReplacement(
36 content::RenderFrame* render_frame,
37 const base::FilePath& plugin_path) OVERRIDE;
38 virtual bool WillSendRequest(blink::WebFrame* frame,
39 ui::PageTransition transition_type,
41 const GURL& first_party_for_cookies,
42 GURL* new_url) OVERRIDE;
43 virtual void DidCreateScriptContext(blink::WebFrame* frame,
44 v8::Handle<v8::Context> context,
46 int world_id) OVERRIDE;
47 virtual const void* CreatePPAPIInterface(
48 const std::string& interface_name) OVERRIDE;
49 virtual bool IsExternalPepperPlugin(const std::string& module_name) OVERRIDE;
50 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE;
51 virtual content::BrowserPluginDelegate* CreateBrowserPluginDelegate(
52 content::RenderFrame* render_frame,
53 const std::string& mime_type) OVERRIDE;
56 scoped_ptr<ShellExtensionsClient> extensions_client_;
57 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_;
58 scoped_ptr<DispatcherDelegate> extension_dispatcher_delegate_;
59 scoped_ptr<Dispatcher> extension_dispatcher_;
61 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient);
64 } // namespace extensions
66 #endif // EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_