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/shell_content_renderer_client.h" | 5 #include "content/shell/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/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return NULL; | 150 return NULL; |
151 if (!hyphenator_) | 151 if (!hyphenator_) |
152 hyphenator_.reset(new webkit_glue::MockWebHyphenator); | 152 hyphenator_.reset(new webkit_glue::MockWebHyphenator); |
153 return hyphenator_.get(); | 153 return hyphenator_.get(); |
154 | 154 |
155 } | 155 } |
156 | 156 |
157 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() { | 157 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() { |
158 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 158 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
159 return NULL; | 159 return NULL; |
160 // TODO(jochen): return the TestRunner library's theme engine once WebKit has | 160 return ShellRenderProcessObserver::GetInstance()->test_interfaces() |
161 // rolled. | 161 ->themeEngine(); |
162 return NULL; | |
163 } | 162 } |
164 | 163 |
165 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, | 164 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, |
166 WebTestProxyBase* proxy) { | 165 WebTestProxyBase* proxy) { |
167 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); | 166 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); |
168 test_runner->set_proxy(proxy); | 167 test_runner->set_proxy(proxy); |
169 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) | 168 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) |
170 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); | 169 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); |
171 proxy->setInterfaces( | 170 proxy->setInterfaces( |
172 ShellRenderProcessObserver::GetInstance()->test_interfaces()); | 171 ShellRenderProcessObserver::GetInstance()->test_interfaces()); |
173 test_runner->proxy()->setDelegate( | 172 test_runner->proxy()->setDelegate( |
174 ShellRenderProcessObserver::GetInstance()->test_delegate()); | 173 ShellRenderProcessObserver::GetInstance()->test_delegate()); |
175 } | 174 } |
176 | 175 |
177 bool ShellContentRendererClient::AllowBrowserPlugin( | 176 bool ShellContentRendererClient::AllowBrowserPlugin( |
178 WebKit::WebPluginContainer* container) const { | 177 WebKit::WebPluginContainer* container) const { |
179 if (CommandLine::ForCurrentProcess()->HasSwitch( | 178 if (CommandLine::ForCurrentProcess()->HasSwitch( |
180 switches::kEnableBrowserPluginForAllViewTypes)) { | 179 switches::kEnableBrowserPluginForAllViewTypes)) { |
181 // Allow BrowserPlugin if forced by command line flag. This is generally | 180 // Allow BrowserPlugin if forced by command line flag. This is generally |
182 // true for tests. | 181 // true for tests. |
183 return true; | 182 return true; |
184 } | 183 } |
185 return ContentRendererClient::AllowBrowserPlugin(container); | 184 return ContentRendererClient::AllowBrowserPlugin(container); |
186 } | 185 } |
187 | 186 |
188 } // namespace content | 187 } // namespace content |
OLD | NEW |