Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: content/renderer/devtools/devtools_client.cc

Issue 2403633002: [DevTools] Move sanitize url to devtools_ui.cc. (Closed)
Patch Set: disable test on android and ios - there is no devtools_ui Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/Runtime.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/devtools/devtools_client.h" 5 #include "content/renderer/devtools/devtools_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/common/devtools_messages.h" 10 #include "content/common/devtools_messages.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace content { 23 namespace content {
24 24
25 DevToolsClient::DevToolsClient( 25 DevToolsClient::DevToolsClient(
26 RenderFrame* main_render_frame, 26 RenderFrame* main_render_frame,
27 const std::string& compatibility_script) 27 const std::string& compatibility_script)
28 : RenderFrameObserver(main_render_frame), 28 : RenderFrameObserver(main_render_frame),
29 compatibility_script_(compatibility_script), 29 compatibility_script_(compatibility_script),
30 web_tools_frontend_( 30 web_tools_frontend_(
31 WebDevToolsFrontend::create(main_render_frame->GetWebFrame(), this)) { 31 WebDevToolsFrontend::create(main_render_frame->GetWebFrame(), this)) {
32 compatibility_script_ += "\n//# sourceURL=devtools_compatibility.js";
32 } 33 }
33 34
34 DevToolsClient::~DevToolsClient() { 35 DevToolsClient::~DevToolsClient() {
35 } 36 }
36 37
37 void DevToolsClient::DidClearWindowObject() { 38 void DevToolsClient::DidClearWindowObject() {
38 if (!compatibility_script_.empty()) 39 if (!compatibility_script_.empty())
39 render_frame()->ExecuteJavaScript(base::UTF8ToUTF16(compatibility_script_)); 40 render_frame()->ExecuteJavaScript(base::UTF8ToUTF16(compatibility_script_));
40 } 41 }
41 42
42 void DevToolsClient::OnDestruct() { 43 void DevToolsClient::OnDestruct() {
43 delete this; 44 delete this;
44 } 45 }
45 46
46 void DevToolsClient::sendMessageToEmbedder(const WebString& message) { 47 void DevToolsClient::sendMessageToEmbedder(const WebString& message) {
47 Send(new DevToolsHostMsg_DispatchOnEmbedder(routing_id(), 48 Send(new DevToolsHostMsg_DispatchOnEmbedder(routing_id(),
48 message.utf8())); 49 message.utf8()));
49 } 50 }
50 51
51 bool DevToolsClient::isUnderTest() { 52 bool DevToolsClient::isUnderTest() {
52 return RenderThreadImpl::current()->layout_test_mode(); 53 return RenderThreadImpl::current()->layout_test_mode();
53 } 54 }
54 55
55 } // namespace content 56 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/Runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698