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

Side by Side Diff: chrome/browser/resources/inspect/inspect.js

Issue 12559008: DevTools: add backend for discovering connected ADB devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Offline review comments addressed Created 7 years, 9 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 | « chrome/browser/devtools/protocol_http_request.cc ('k') | chrome/browser/ui/webui/inspect_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) 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 function requestData() { 5 function requestData() {
6 var xhr = new XMLHttpRequest(); 6 var xhr = new XMLHttpRequest();
7 xhr.open('GET', 'targets-data.json', false); 7 xhr.open('GET', 'targets-data.json', false);
8 xhr.send(null); 8 xhr.send(null);
9 if (xhr.status === 200) 9 if (xhr.status === 200)
10 return JSON.parse(xhr.responseText); 10 return JSON.parse(xhr.responseText);
11 return []; 11 return [];
12 } 12 }
13 13
14 function adbQuery(query) {
15 var xhr = new XMLHttpRequest();
16 xhr.open('GET', 'adb-query/' + query, false);
17 xhr.send(null);
18 if (xhr.status === 200)
19 return JSON.parse(xhr.responseText);
20 return [String(xhr.status), ''];
21 }
22
23 function xhr(url) {
24 var xhr = new XMLHttpRequest();
25 xhr.open('GET', 'local-xhr/' + url, false);
26 xhr.send(null);
27 if (xhr.status === 200)
28 return JSON.parse(xhr.responseText);
29 return [String(xhr.status), ''];
30 }
31
14 function inspect(data) { 32 function inspect(data) {
15 chrome.send('inspect', 33 chrome.send('inspect',
16 [String(data.processId), String(data.routeId)]); 34 [String(data.processId), String(data.routeId)]);
17 } 35 }
18 36
19 function terminate(data) { 37 function terminate(data) {
20 chrome.send('terminate', 38 chrome.send('terminate',
21 [String(data.processId), String(data.routeId)]); 39 [String(data.processId), String(data.routeId)]);
22 } 40 }
23 41
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 link.setAttribute('href', '#'); 142 link.setAttribute('href', '#');
125 link.textContent = ' terminate '; 143 link.textContent = ' terminate ';
126 link.addEventListener( 144 link.addEventListener(
127 'click', 145 'click',
128 terminate.bind(this, data), 146 terminate.bind(this, data),
129 true); 147 true);
130 return link; 148 return link;
131 } 149 }
132 150
133 document.addEventListener('DOMContentLoaded', populateLists); 151 document.addEventListener('DOMContentLoaded', populateLists);
OLDNEW
« no previous file with comments | « chrome/browser/devtools/protocol_http_request.cc ('k') | chrome/browser/ui/webui/inspect_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698