| 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/renderer/devtools_client.h" | 5 #include "content/renderer/devtools_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/common/devtools_messages.h" | 10 #include "content/common/devtools_messages.h" |
| 11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 #include "content/renderer/render_thread_impl.h" | 12 #include "content/renderer/render_thread_impl.h" |
| 13 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h
" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h
" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoin
t.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoin
t.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 17 #include "ui/base/ui_base_switches.h" | 17 #include "ui/base/ui_base_switches.h" |
| 18 | 18 |
| 19 using WebKit::WebDevToolsFrontend; | 19 using WebKit::WebDevToolsFrontend; |
| 20 using WebKit::WebString; | 20 using WebKit::WebString; |
| 21 | 21 |
| 22 namespace content { |
| 23 |
| 22 DevToolsClient::DevToolsClient(RenderViewImpl* render_view) | 24 DevToolsClient::DevToolsClient(RenderViewImpl* render_view) |
| 23 : content::RenderViewObserver(render_view) { | 25 : RenderViewObserver(render_view) { |
| 24 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 26 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 25 web_tools_frontend_.reset( | 27 web_tools_frontend_.reset( |
| 26 WebDevToolsFrontend::create( | 28 WebDevToolsFrontend::create( |
| 27 render_view->webview(), | 29 render_view->webview(), |
| 28 this, | 30 this, |
| 29 ASCIIToUTF16(command_line.GetSwitchValueASCII(switches::kLang)))); | 31 ASCIIToUTF16(command_line.GetSwitchValueASCII(switches::kLang)))); |
| 30 } | 32 } |
| 31 | 33 |
| 32 DevToolsClient::~DevToolsClient() { | 34 DevToolsClient::~DevToolsClient() { |
| 33 } | 35 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 const WebKit::WebString& content) { | 99 const WebKit::WebString& content) { |
| 98 Send(new DevToolsHostMsg_Append(routing_id(), | 100 Send(new DevToolsHostMsg_Append(routing_id(), |
| 99 url.utf8(), | 101 url.utf8(), |
| 100 content.utf8())); | 102 content.utf8())); |
| 101 } | 103 } |
| 102 | 104 |
| 103 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { | 105 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { |
| 104 web_tools_frontend_->dispatchOnInspectorFrontend( | 106 web_tools_frontend_->dispatchOnInspectorFrontend( |
| 105 WebString::fromUTF8(message)); | 107 WebString::fromUTF8(message)); |
| 106 } | 108 } |
| 109 |
| 110 } // namespace content |
| OLD | NEW |