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

Side by Side Diff: android_webview/native/aw_dev_tools_server.cc

Issue 138913021: Avoid discarding freshly created background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (last_selected) Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_server.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698