| 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 "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/common/devtools_messages.h" | 11 #include "chrome/common/devtools_messages.h" |
| 12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
| 13 #include "chrome/renderer/render_thread.h" | 13 #include "chrome/renderer/render_thread.h" |
| 14 #include "chrome/renderer/render_view.h" | 14 #include "chrome/renderer/render_view.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h
" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h
" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 17 #include "ui/base/ui_base_switches.h" |
| 17 | 18 |
| 18 using WebKit::WebDevToolsFrontend; | 19 using WebKit::WebDevToolsFrontend; |
| 19 using WebKit::WebString; | 20 using WebKit::WebString; |
| 20 | 21 |
| 21 DevToolsClient::DevToolsClient(RenderView* render_view) | 22 DevToolsClient::DevToolsClient(RenderView* render_view) |
| 22 : RenderViewObserver(render_view) { | 23 : RenderViewObserver(render_view) { |
| 23 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 24 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 24 web_tools_frontend_.reset( | 25 web_tools_frontend_.reset( |
| 25 WebDevToolsFrontend::create( | 26 WebDevToolsFrontend::create( |
| 26 render_view->webview(), | 27 render_view->webview(), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 80 |
| 80 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { | 81 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { |
| 81 web_tools_frontend_->dispatchOnInspectorFrontend( | 82 web_tools_frontend_->dispatchOnInspectorFrontend( |
| 82 WebString::fromUTF8(message)); | 83 WebString::fromUTF8(message)); |
| 83 } | 84 } |
| 84 | 85 |
| 85 bool DevToolsClient::shouldHideScriptsPanel() { | 86 bool DevToolsClient::shouldHideScriptsPanel() { |
| 86 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 87 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 87 return cmd->HasSwitch(switches::kRemoteShellPort); | 88 return cmd->HasSwitch(switches::kRemoteShellPort); |
| 88 } | 89 } |
| OLD | NEW |