| 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 "content/public/common/content_constants.h" | 9 #include "content/public/common/content_constants.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 ShellContentRendererClient::~ShellContentRendererClient() { | 53 ShellContentRendererClient::~ShellContentRendererClient() { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ShellContentRendererClient::RenderThreadStarted() { | 56 void ShellContentRendererClient::RenderThreadStarted() { |
| 57 shell_observer_.reset(new ShellRenderProcessObserver()); | 57 shell_observer_.reset(new ShellRenderProcessObserver()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { | 60 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { |
| 61 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 62 return; |
| 61 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); | 63 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); |
| 62 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) { | 64 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) { |
| 63 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view, | 65 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view, |
| 64 test_runner, | 66 test_runner, |
| 65 test_runner); | 67 test_runner); |
| 66 } | 68 } |
| 67 } | 69 } |
| 68 | 70 |
| 69 bool ShellContentRendererClient::OverrideCreatePlugin( | 71 bool ShellContentRendererClient::OverrideCreatePlugin( |
| 70 RenderView* render_view, | 72 RenderView* render_view, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 return true; | 111 return true; |
| 110 } | 112 } |
| 111 if (render_process_observer->test_delegate()) { | 113 if (render_process_observer->test_delegate()) { |
| 112 *new_url = render_process_observer->test_delegate()->rewriteLayoutTestsURL( | 114 *new_url = render_process_observer->test_delegate()->rewriteLayoutTestsURL( |
| 113 url.spec()); | 115 url.spec()); |
| 114 } | 116 } |
| 115 return true; | 117 return true; |
| 116 } | 118 } |
| 117 | 119 |
| 118 } // namespace content | 120 } // namespace content |
| OLD | NEW |