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 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 5 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (!settings.empty()) | 55 if (!settings.empty()) |
56 result = GURL(base::StringPrintf("%s?settings=%s&experiments=true", | 56 result = GURL(base::StringPrintf("%s?settings=%s&experiments=true", |
57 result.spec().c_str(), | 57 result.spec().c_str(), |
58 settings.c_str())); | 58 settings.c_str())); |
59 return result; | 59 return result; |
60 } | 60 } |
61 | 61 |
62 void LayoutTestDevToolsFrontend::ReuseFrontend(const std::string& settings, | 62 void LayoutTestDevToolsFrontend::ReuseFrontend(const std::string& settings, |
63 const std::string frontend_url) { | 63 const std::string frontend_url) { |
64 DisconnectFromTarget(); | 64 DisconnectFromTarget(); |
| 65 preferences()->Clear(); |
65 frontend_shell()->LoadURL(GetDevToolsPathAsURL(settings, frontend_url)); | 66 frontend_shell()->LoadURL(GetDevToolsPathAsURL(settings, frontend_url)); |
66 } | 67 } |
67 | 68 |
68 LayoutTestDevToolsFrontend::LayoutTestDevToolsFrontend( | 69 LayoutTestDevToolsFrontend::LayoutTestDevToolsFrontend( |
69 Shell* frontend_shell, | 70 Shell* frontend_shell, |
70 WebContents* inspected_contents) | 71 WebContents* inspected_contents) |
71 : ShellDevToolsFrontend(frontend_shell, inspected_contents) { | 72 : ShellDevToolsFrontend(frontend_shell, inspected_contents) { |
72 } | 73 } |
73 | 74 |
74 LayoutTestDevToolsFrontend::~LayoutTestDevToolsFrontend() { | 75 LayoutTestDevToolsFrontend::~LayoutTestDevToolsFrontend() { |
75 } | 76 } |
76 | 77 |
77 void LayoutTestDevToolsFrontend::AgentHostClosed( | 78 void LayoutTestDevToolsFrontend::AgentHostClosed( |
78 DevToolsAgentHost* agent_host, bool replaced) { | 79 DevToolsAgentHost* agent_host, bool replaced) { |
79 // Do not close the front-end shell. | 80 // Do not close the front-end shell. |
80 } | 81 } |
81 | 82 |
82 void LayoutTestDevToolsFrontend::RenderProcessGone( | 83 void LayoutTestDevToolsFrontend::RenderProcessGone( |
83 base::TerminationStatus status) { | 84 base::TerminationStatus status) { |
84 WebKitTestController::Get()->DevToolsProcessCrashed(); | 85 WebKitTestController::Get()->DevToolsProcessCrashed(); |
85 } | 86 } |
86 | 87 |
87 } // namespace content | 88 } // namespace content |
OLD | NEW |