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

Side by Side Diff: chrome/browser/devtools/devtools_adb_bridge.cc

Issue 65143004: DevTools: Refactor InspectUI class for extensibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments, rebased Created 7 years, 1 month 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/devtools/devtools_targets_ui.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/devtools/devtools_adb_bridge.h" 5 #include "chrome/browser/devtools/devtools_adb_bridge.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1037 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1038 if (debug_url.empty()) 1038 if (debug_url.empty())
1039 return; 1039 return;
1040 DevToolsProtocol::Command command(1, method, params); 1040 DevToolsProtocol::Command command(1, method, params);
1041 new AdbProtocolCommand( 1041 new AdbProtocolCommand(
1042 adb_thread_, device_, socket_, debug_url, command.Serialize()); 1042 adb_thread_, device_, socket_, debug_url, command.Serialize());
1043 } 1043 }
1044 1044
1045 static void NoOp(int, const std::string&) {} 1045 static void NoOp(int, const std::string&) {}
1046 1046
1047 void DevToolsAdbBridge::RemoteBrowser::Open(const std::string& url) { 1047 void DevToolsAdbBridge::RemoteBrowser::Open(const std::string& input_url) {
1048 GURL gurl(input_url);
1049 if (!gurl.is_valid()) {
1050 gurl = GURL("http://" + input_url);
1051 if (!gurl.is_valid())
1052 return;
1053 }
1054 std::string url = gurl.spec();
1055
1048 ParsedVersion parsed_version = GetParsedVersion(); 1056 ParsedVersion parsed_version = GetParsedVersion();
1049 if (IsChrome() && 1057 if (IsChrome() &&
1050 !parsed_version.empty() && 1058 !parsed_version.empty() &&
1051 parsed_version[0] >= kMinVersionNewWithURL) { 1059 parsed_version[0] >= kMinVersionNewWithURL) {
1052 std::string query = net::EscapeQueryParamValue(url, false /* use_plus */); 1060 std::string query = net::EscapeQueryParamValue(url, false /* use_plus */);
1053 std::string request = 1061 std::string request =
1054 base::StringPrintf(kNewPageRequestWithURL, query.c_str()); 1062 base::StringPrintf(kNewPageRequestWithURL, query.c_str());
1055 adb_thread_->message_loop()->PostTask(FROM_HERE, 1063 adb_thread_->message_loop()->PostTask(FROM_HERE,
1056 base::Bind(&AndroidDevice::HttpQuery, 1064 base::Bind(&AndroidDevice::HttpQuery,
1057 device_, socket_, request, base::Bind(&NoOp))); 1065 device_, socket_, request, base::Bind(&NoOp)));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 1178
1171 if (listeners_.empty()) 1179 if (listeners_.empty())
1172 return; 1180 return;
1173 1181
1174 BrowserThread::PostDelayedTask( 1182 BrowserThread::PostDelayedTask(
1175 BrowserThread::UI, 1183 BrowserThread::UI,
1176 FROM_HERE, 1184 FROM_HERE,
1177 base::Bind(&DevToolsAdbBridge::RequestRemoteDevices, this), 1185 base::Bind(&DevToolsAdbBridge::RequestRemoteDevices, this),
1178 base::TimeDelta::FromMilliseconds(kAdbPollingIntervalMs)); 1186 base::TimeDelta::FromMilliseconds(kAdbPollingIntervalMs));
1179 } 1187 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_targets_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698