OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/device/adb/adb_device_info_query.h" | 5 #include "chrome/browser/devtools/device/adb/adb_device_info_query.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 | 229 |
230 void AdbDeviceInfoQuery::ReceivedModel(int result, | 230 void AdbDeviceInfoQuery::ReceivedModel(int result, |
231 const std::string& response) { | 231 const std::string& response) { |
232 DCHECK(CalledOnValidThread()); | 232 DCHECK(CalledOnValidThread()); |
233 if (result < 0) { | 233 if (result < 0) { |
234 Respond(); | 234 Respond(); |
235 return; | 235 return; |
236 } | 236 } |
237 device_info_.model = response; | 237 device_info_.model = response; |
| 238 device_info_.connected = true; |
238 command_callback_.Run( | 239 command_callback_.Run( |
239 kDumpsysCommand, | 240 kDumpsysCommand, |
240 base::Bind(&AdbDeviceInfoQuery::ReceivedDumpsys, base::Unretained(this))); | 241 base::Bind(&AdbDeviceInfoQuery::ReceivedDumpsys, base::Unretained(this))); |
241 } | 242 } |
242 | 243 |
243 void AdbDeviceInfoQuery::ReceivedDumpsys(int result, | 244 void AdbDeviceInfoQuery::ReceivedDumpsys(int result, |
244 const std::string& response) { | 245 const std::string& response) { |
245 DCHECK(CalledOnValidThread()); | 246 DCHECK(CalledOnValidThread()); |
246 if (result >= 0) | 247 if (result >= 0) |
247 ParseDumpsysResponse(response); | 248 ParseDumpsysResponse(response); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 descriptor->display_name; | 404 descriptor->display_name; |
404 } | 405 } |
405 } | 406 } |
406 } | 407 } |
407 | 408 |
408 void AdbDeviceInfoQuery::Respond() { | 409 void AdbDeviceInfoQuery::Respond() { |
409 DCHECK(CalledOnValidThread()); | 410 DCHECK(CalledOnValidThread()); |
410 callback_.Run(device_info_); | 411 callback_.Run(device_info_); |
411 delete this; | 412 delete this; |
412 } | 413 } |
OLD | NEW |