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 APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ 6 #define APPS_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 13 namespace extensions { 14 class Dispatcher; 15 class DispatcherDelegate; 16 } 17 18 namespace apps { 19 20 class ShellExtensionsClient; 21 class ShellExtensionsRendererClient; 22 class ShellRendererMainDelegate; 23 24 // Renderer initialization and runtime support for app_shell. 25 class ShellContentRendererClient : public content::ContentRendererClient { 26 public: 27 explicit ShellContentRendererClient( 28 scoped_ptr<ShellRendererMainDelegate> delegate); 29 virtual ~ShellContentRendererClient(); 30 31 // content::ContentRendererClient implementation: 32 virtual void RenderThreadStarted() OVERRIDE; 33 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; 34 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; 35 virtual bool WillSendRequest(blink::WebFrame* frame, 36 content::PageTransition transition_type, 37 const GURL& url, 38 const GURL& first_party_for_cookies, 39 GURL* new_url) OVERRIDE; 40 virtual void DidCreateScriptContext(blink::WebFrame* frame, 41 v8::Handle<v8::Context> context, 42 int extension_group, 43 int world_id) OVERRIDE; 44 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE; 45 46 private: 47 scoped_ptr<ShellRendererMainDelegate> delegate_; 48 scoped_ptr<ShellExtensionsClient> extensions_client_; 49 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; 50 scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; 51 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; 52 53 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); 54 }; 55 56 } // namespace apps 57 58 #endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ 59