shell_content_renderer_client.h revision 1320f92c476a1ad9d19dba2a48c72b75566198e9
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. 4 5#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ 6#define EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ 7 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" 12 13namespace extensions { 14 15class Dispatcher; 16class DispatcherDelegate; 17class ShellExtensionsClient; 18class ShellExtensionsRendererClient; 19class ShellRendererMainDelegate; 20 21// Renderer initialization and runtime support for app_shell. 22class ShellContentRendererClient : public content::ContentRendererClient { 23 public: 24 ShellContentRendererClient(); 25 virtual ~ShellContentRendererClient(); 26 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, 40 const GURL& url, 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, 45 int extension_group, 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; 54 55 private: 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_; 60 61 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); 62}; 63 64} // namespace extensions 65 66#endif // EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ 67