OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "android_webview/native/aw_dev_tools_server.h" | 5 #include "android_webview/native/aw_dev_tools_server.h" |
6 | 6 |
7 #include "android_webview/browser/in_process_view_renderer.h" | 7 #include "android_webview/browser/in_process_view_renderer.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 base::TimeTicks last_activity_time_; | 65 base::TimeTicks last_activity_time_; |
66 }; | 66 }; |
67 | 67 |
68 Target::Target(WebContents* web_contents) { | 68 Target::Target(WebContents* web_contents) { |
69 agent_host_ = | 69 agent_host_ = |
70 DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost()); | 70 DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost()); |
71 id_ = agent_host_->GetId(); | 71 id_ = agent_host_->GetId(); |
72 description_ = GetViewDescription(web_contents); | 72 description_ = GetViewDescription(web_contents); |
73 title_ = base::UTF16ToUTF8(web_contents->GetTitle()); | 73 title_ = base::UTF16ToUTF8(web_contents->GetTitle()); |
74 url_ = web_contents->GetURL(); | 74 url_ = web_contents->GetURL(); |
75 last_activity_time_ = web_contents->GetLastSelectedTime(); | 75 last_activity_time_ = web_contents->GetLastActiveTime(); |
76 } | 76 } |
77 | 77 |
78 // Delegate implementation for the devtools http handler for WebView. A new | 78 // Delegate implementation for the devtools http handler for WebView. A new |
79 // instance of this gets created each time web debugging is enabled. | 79 // instance of this gets created each time web debugging is enabled. |
80 class AwDevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate { | 80 class AwDevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate { |
81 public: | 81 public: |
82 AwDevToolsServerDelegate() {} | 82 AwDevToolsServerDelegate() {} |
83 virtual ~AwDevToolsServerDelegate() {} | 83 virtual ~AwDevToolsServerDelegate() {} |
84 | 84 |
85 // DevToolsHttpProtocolHandler::Delegate overrides. | 85 // DevToolsHttpProtocolHandler::Delegate overrides. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 AwDevToolsServer* devtools_server = | 216 AwDevToolsServer* devtools_server = |
217 reinterpret_cast<AwDevToolsServer*>(server); | 217 reinterpret_cast<AwDevToolsServer*>(server); |
218 if (enabled) { | 218 if (enabled) { |
219 devtools_server->Start(); | 219 devtools_server->Start(); |
220 } else { | 220 } else { |
221 devtools_server->Stop(); | 221 devtools_server->Stop(); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 } // namespace android_webview | 225 } // namespace android_webview |
OLD | NEW |