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

Unified Diff: chrome/browser/devtools/device/android_device_manager.cc

Issue 274573002: DevTools: Extract ADB specific requests from DevToolsAndroidBridge into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/device/android_device_manager.cc
diff --git a/chrome/browser/devtools/device/android_device_manager.cc b/chrome/browser/devtools/device/android_device_manager.cc
index d4b31c92f9b5a1b11071575f6bf6bd59ccec3694..5dd2627122831a5a0313f2ba39e414c6e749114a 100644
--- a/chrome/browser/devtools/device/android_device_manager.cc
+++ b/chrome/browser/devtools/device/android_device_manager.cc
@@ -11,8 +11,6 @@
#include "net/base/net_errors.h"
#include "net/socket/stream_socket.h"
-using content::BrowserThread;
-
namespace {
const int kBufferSize = 16 * 1024;
@@ -176,6 +174,16 @@ class HttpRequest {
} // namespace
+AndroidDeviceManager::BrowserInfo::BrowserInfo()
+ : type(kTypeOther) {
+}
+
+AndroidDeviceManager::DeviceInfo::DeviceInfo() {
+}
+
+AndroidDeviceManager::DeviceInfo::~DeviceInfo() {
+}
+
AndroidDeviceManager::Device::Device(const std::string& serial,
bool is_connected)
: serial_(serial),
@@ -217,16 +225,14 @@ bool AndroidDeviceManager::IsConnected(const std::string& serial) {
return device && device->is_connected();
}
-void AndroidDeviceManager::RunCommand(
- const std::string& serial,
- const std::string& command,
- const CommandCallback& callback) {
+void AndroidDeviceManager::QueryDeviceInfo(const std::string& serial,
+ const DeviceInfoCallback& callback) {
DCHECK(CalledOnValidThread());
Device* device = FindDevice(serial);
if (device)
- device->RunCommand(command, callback);
+ device->QueryDeviceInfo(callback);
else
- callback.Run(net::ERR_CONNECTION_FAILED, std::string());
+ callback.Run(DeviceInfo());
}
void AndroidDeviceManager::OpenSocket(
« no previous file with comments | « chrome/browser/devtools/device/android_device_manager.h ('k') | chrome/browser/devtools/device/devtools_android_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698