| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ | 5 #ifndef APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ |
| 6 #define APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ | 6 #define APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/renderer/content_renderer_client.h" | 11 #include "content/public/renderer/content_renderer_client.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 class Dispatcher; | 14 class Dispatcher; |
| 15 class DispatcherDelegate; | 15 class DispatcherDelegate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace apps { | 18 namespace apps { |
| 19 | 19 |
| 20 class ShellExtensionsClient; | 20 class ShellExtensionsClient; |
| 21 class ShellExtensionsRendererClient; | 21 class ShellExtensionsRendererClient; |
| 22 class ShellRendererMainDelegate; |
| 22 | 23 |
| 23 // Renderer initialization and runtime support for app_shell. | 24 // Renderer initialization and runtime support for app_shell. |
| 24 class ShellContentRendererClient : public content::ContentRendererClient { | 25 class ShellContentRendererClient : public content::ContentRendererClient { |
| 25 public: | 26 public: |
| 26 ShellContentRendererClient(); | 27 explicit ShellContentRendererClient(ShellRendererMainDelegate* delegate); |
| 27 virtual ~ShellContentRendererClient(); | 28 virtual ~ShellContentRendererClient(); |
| 28 | 29 |
| 29 // content::ContentRendererClient implementation: | 30 // content::ContentRendererClient implementation: |
| 30 virtual void RenderThreadStarted() OVERRIDE; | 31 virtual void RenderThreadStarted() OVERRIDE; |
| 31 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; | 32 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; |
| 32 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; | 33 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; |
| 33 virtual bool WillSendRequest(blink::WebFrame* frame, | 34 virtual bool WillSendRequest(blink::WebFrame* frame, |
| 34 content::PageTransition transition_type, | 35 content::PageTransition transition_type, |
| 35 const GURL& url, | 36 const GURL& url, |
| 36 const GURL& first_party_for_cookies, | 37 const GURL& first_party_for_cookies, |
| 37 GURL* new_url) OVERRIDE; | 38 GURL* new_url) OVERRIDE; |
| 38 virtual void DidCreateScriptContext(blink::WebFrame* frame, | 39 virtual void DidCreateScriptContext(blink::WebFrame* frame, |
| 39 v8::Handle<v8::Context> context, | 40 v8::Handle<v8::Context> context, |
| 40 int extension_group, | 41 int extension_group, |
| 41 int world_id) OVERRIDE; | 42 int world_id) OVERRIDE; |
| 42 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE; | 43 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE; |
| 43 | 44 |
| 44 private: | 45 private: |
| 46 ShellRendererMainDelegate* delegate_; |
| 45 scoped_ptr<ShellExtensionsClient> extensions_client_; | 47 scoped_ptr<ShellExtensionsClient> extensions_client_; |
| 46 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; | 48 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; |
| 47 scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; | 49 scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; |
| 48 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; | 50 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; |
| 49 | 51 |
| 50 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); | 52 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace apps | 55 } // namespace apps |
| 54 | 56 |
| 55 #endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ | 57 #endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ |
| OLD | NEW |