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( |
| 28 scoped_ptr<ShellRendererMainDelegate> delegate); |
27 virtual ~ShellContentRendererClient(); | 29 virtual ~ShellContentRendererClient(); |
28 | 30 |
29 // content::ContentRendererClient implementation: | 31 // content::ContentRendererClient implementation: |
30 virtual void RenderThreadStarted() OVERRIDE; | 32 virtual void RenderThreadStarted() OVERRIDE; |
31 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; | 33 virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; |
32 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; | 34 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; |
33 virtual bool WillSendRequest(blink::WebFrame* frame, | 35 virtual bool WillSendRequest(blink::WebFrame* frame, |
34 content::PageTransition transition_type, | 36 content::PageTransition transition_type, |
35 const GURL& url, | 37 const GURL& url, |
36 const GURL& first_party_for_cookies, | 38 const GURL& first_party_for_cookies, |
37 GURL* new_url) OVERRIDE; | 39 GURL* new_url) OVERRIDE; |
38 virtual void DidCreateScriptContext(blink::WebFrame* frame, | 40 virtual void DidCreateScriptContext(blink::WebFrame* frame, |
39 v8::Handle<v8::Context> context, | 41 v8::Handle<v8::Context> context, |
40 int extension_group, | 42 int extension_group, |
41 int world_id) OVERRIDE; | 43 int world_id) OVERRIDE; |
42 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE; | 44 virtual bool ShouldEnableSiteIsolationPolicy() const OVERRIDE; |
43 | 45 |
44 private: | 46 private: |
| 47 scoped_ptr<ShellRendererMainDelegate> delegate_; |
45 scoped_ptr<ShellExtensionsClient> extensions_client_; | 48 scoped_ptr<ShellExtensionsClient> extensions_client_; |
46 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; | 49 scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; |
47 scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; | 50 scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; |
48 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; | 51 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; |
49 | 52 |
50 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); | 53 DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); |
51 }; | 54 }; |
52 | 55 |
53 } // namespace apps | 56 } // namespace apps |
54 | 57 |
55 #endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ | 58 #endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ |
OLD | NEW |