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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "content/common/sandbox_win.h" | 10 #include "content/common/sandbox_win.h" |
11 #include "content/public/common/content_constants.h" | 11 #include "content/public/common/content_constants.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "content/public/renderer/render_view.h" | 13 #include "content/public/renderer/render_view.h" |
14 #include "content/public/test/layouttest_support.h" | 14 #include "content/public/test/layouttest_support.h" |
15 #include "content/shell/common/shell_switches.h" | 15 #include "content/shell/common/shell_switches.h" |
16 #include "content/shell/common/webkit_test_helpers.h" | 16 #include "content/shell/common/webkit_test_helpers.h" |
17 #include "content/shell/renderer/shell_render_frame_observer.h" | 17 #include "content/shell/renderer/shell_render_frame_observer.h" |
18 #include "content/shell/renderer/shell_render_process_observer.h" | 18 #include "content/shell/renderer/shell_render_process_observer.h" |
19 #include "content/shell/renderer/shell_render_view_observer.h" | 19 #include "content/shell/renderer/shell_render_view_observer.h" |
20 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 20 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
21 #include "content/shell/renderer/test_runner/WebTestProxy.h" | |
22 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 21 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 22 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
23 #include "content/shell/renderer/webkit_test_runner.h" | 23 #include "content/shell/renderer/webkit_test_runner.h" |
24 #include "content/test/mock_webclipboard_impl.h" | 24 #include "content/test/mock_webclipboard_impl.h" |
25 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 25 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
26 #include "third_party/WebKit/public/web/WebPluginParams.h" | 26 #include "third_party/WebKit/public/web/WebPluginParams.h" |
27 #include "third_party/WebKit/public/web/WebView.h" | 27 #include "third_party/WebKit/public/web/WebView.h" |
28 #include "v8/include/v8.h" | 28 #include "v8/include/v8.h" |
29 | 29 |
30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
31 #include "content/public/renderer/render_font_warmup_win.h" | 31 #include "content/public/renderer/render_font_warmup_win.h" |
32 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 32 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 | 98 |
99 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { | 99 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { |
100 new ShellRenderViewObserver(render_view); | 100 new ShellRenderViewObserver(render_view); |
101 | 101 |
102 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 102 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
103 return; | 103 return; |
104 WebKitTestRunner* test_runner = WebKitTestRunner::Get(render_view); | 104 WebKitTestRunner* test_runner = WebKitTestRunner::Get(render_view); |
105 test_runner->Reset(); | 105 test_runner->Reset(); |
106 render_view->GetWebView()->setSpellCheckClient( | 106 render_view->GetWebView()->setSpellCheckClient( |
107 test_runner->proxy()->spellCheckClient()); | 107 test_runner->proxy()->GetSpellCheckClient()); |
108 WebTestDelegate* delegate = | 108 WebTestDelegate* delegate = |
109 ShellRenderProcessObserver::GetInstance()->test_delegate(); | 109 ShellRenderProcessObserver::GetInstance()->test_delegate(); |
110 if (delegate == static_cast<WebTestDelegate*>(test_runner)) | 110 if (delegate == static_cast<WebTestDelegate*>(test_runner)) |
111 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view); | 111 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view); |
112 } | 112 } |
113 | 113 |
114 bool ShellContentRendererClient::OverrideCreatePlugin( | 114 bool ShellContentRendererClient::OverrideCreatePlugin( |
115 RenderFrame* render_frame, | 115 RenderFrame* render_frame, |
116 WebLocalFrame* frame, | 116 WebLocalFrame* frame, |
117 const WebPluginParams& params, | 117 const WebPluginParams& params, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return ShellRenderProcessObserver::GetInstance()->test_interfaces() | 179 return ShellRenderProcessObserver::GetInstance()->test_interfaces() |
180 ->themeEngine(); | 180 ->themeEngine(); |
181 } | 181 } |
182 | 182 |
183 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, | 183 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, |
184 WebTestProxyBase* proxy) { | 184 WebTestProxyBase* proxy) { |
185 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); | 185 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); |
186 test_runner->set_proxy(proxy); | 186 test_runner->set_proxy(proxy); |
187 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) | 187 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) |
188 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); | 188 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); |
189 proxy->setInterfaces( | 189 proxy->SetInterfaces( |
190 ShellRenderProcessObserver::GetInstance()->test_interfaces()); | 190 ShellRenderProcessObserver::GetInstance()->test_interfaces()); |
191 test_runner->proxy()->setDelegate( | 191 test_runner->proxy()->SetDelegate( |
192 ShellRenderProcessObserver::GetInstance()->test_delegate()); | 192 ShellRenderProcessObserver::GetInstance()->test_delegate()); |
193 } | 193 } |
194 | 194 |
195 bool ShellContentRendererClient::AllowBrowserPlugin( | 195 bool ShellContentRendererClient::AllowBrowserPlugin( |
196 blink::WebPluginContainer* container) { | 196 blink::WebPluginContainer* container) { |
197 return true; | 197 return true; |
198 } | 198 } |
199 | 199 |
200 } // namespace content | 200 } // namespace content |
OLD | NEW |