OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/devtools_client.h" | 5 #include "chrome/renderer/devtools_client.h" |
6 | 6 |
7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/devtools_messages.h" | 10 #include "chrome/common/devtools_messages.h" |
11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
12 #include "chrome/renderer/render_thread.h" | 12 #include "chrome/renderer/render_thread.h" |
13 #include "chrome/renderer/render_view.h" | 13 #include "chrome/renderer/render_view.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontend.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontend.h" |
15 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
16 | 16 |
17 using WebKit::WebDevToolsFrontend; | 17 using WebKit::WebDevToolsFrontend; |
18 using WebKit::WebString; | 18 using WebKit::WebString; |
19 | 19 |
20 DevToolsClient::DevToolsClient(RenderView* view) | 20 DevToolsClient::DevToolsClient(RenderView* view) |
21 : render_view_(view) { | 21 : render_view_(view) { |
22 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 22 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
23 web_tools_frontend_.reset( | 23 web_tools_frontend_.reset( |
24 WebDevToolsFrontend::create( | 24 WebDevToolsFrontend::create( |
25 view->webview(), | 25 view->webview(), |
26 this, | 26 this, |
27 WideToUTF16Hack(command_line.GetSwitchValue(switches::kLang)))); | 27 ASCIIToUTF16(command_line.GetSwitchValueASCII(switches::kLang)))); |
28 } | 28 } |
29 | 29 |
30 DevToolsClient::~DevToolsClient() { | 30 DevToolsClient::~DevToolsClient() { |
31 } | 31 } |
32 | 32 |
33 void DevToolsClient::Send(const IPC::Message& tools_agent_message) { | 33 void DevToolsClient::Send(const IPC::Message& tools_agent_message) { |
34 render_view_->Send(new ViewHostMsg_ForwardToDevToolsAgent( | 34 render_view_->Send(new ViewHostMsg_ForwardToDevToolsAgent( |
35 render_view_->routing_id(), | 35 render_view_->routing_id(), |
36 tools_agent_message)); | 36 tools_agent_message)); |
37 } | 37 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void DevToolsClient::OnDispatchOnInspectorFrontend( | 88 void DevToolsClient::OnDispatchOnInspectorFrontend( |
89 const std::string& message) { | 89 const std::string& message) { |
90 web_tools_frontend_->dispatchOnInspectorFrontend( | 90 web_tools_frontend_->dispatchOnInspectorFrontend( |
91 WebString::fromUTF8(message)); | 91 WebString::fromUTF8(message)); |
92 } | 92 } |
93 | 93 |
94 bool DevToolsClient::shouldHideScriptsPanel() { | 94 bool DevToolsClient::shouldHideScriptsPanel() { |
95 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 95 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
96 return cmd->HasSwitch(switches::kRemoteShellPort); | 96 return cmd->HasSwitch(switches::kRemoteShellPort); |
97 } | 97 } |
OLD | NEW |