OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/shell/renderer/shell_content_renderer_client.h" | 5 #include "content/shell/renderer/shell_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 8 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
10 #include "content/shell/renderer/shell_render_view_observer.h" | 10 #include "content/shell/renderer/shell_render_view_observer.h" |
11 #include "ppapi/shared_impl/ppapi_switches.h" | |
12 #include "third_party/WebKit/public/web/WebView.h" | 11 #include "third_party/WebKit/public/web/WebView.h" |
13 #include "v8/include/v8.h" | 12 #include "v8/include/v8.h" |
14 | 13 |
| 14 #if defined(ENABLE_PLUGINS) |
| 15 #include "ppapi/shared_impl/ppapi_switches.h" |
| 16 #endif |
| 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 ShellContentRendererClient::ShellContentRendererClient() { | 20 ShellContentRendererClient::ShellContentRendererClient() { |
18 } | 21 } |
19 | 22 |
20 ShellContentRendererClient::~ShellContentRendererClient() { | 23 ShellContentRendererClient::~ShellContentRendererClient() { |
21 } | 24 } |
22 | 25 |
23 void ShellContentRendererClient::RenderThreadStarted() { | 26 void ShellContentRendererClient::RenderThreadStarted() { |
24 RenderThread* thread = RenderThread::Get(); | 27 RenderThread* thread = RenderThread::Get(); |
25 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); | 28 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); |
26 thread->AddObserver(web_cache_observer_.get()); | 29 thread->AddObserver(web_cache_observer_.get()); |
27 } | 30 } |
28 | 31 |
29 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { | 32 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { |
30 new ShellRenderViewObserver(render_view); | 33 new ShellRenderViewObserver(render_view); |
31 } | 34 } |
32 | 35 |
33 bool ShellContentRendererClient::IsPluginAllowedToUseCompositorAPI( | 36 bool ShellContentRendererClient::IsPluginAllowedToUseCompositorAPI( |
34 const GURL& url) { | 37 const GURL& url) { |
| 38 #if defined(ENABLE_PLUGINS) |
35 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 39 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
36 switches::kEnablePepperTesting); | 40 switches::kEnablePepperTesting); |
| 41 #else |
| 42 return false; |
| 43 #endif |
37 } | 44 } |
38 | 45 |
39 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { | 46 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { |
| 47 #if defined(ENABLE_PLUGINS) |
40 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 48 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
41 switches::kEnablePepperTesting); | 49 switches::kEnablePepperTesting); |
| 50 #else |
| 51 return false; |
| 52 #endif |
42 } | 53 } |
43 | 54 |
44 } // namespace content | 55 } // namespace content |
OLD | NEW |