Index: chrome/browser/devtools/device/adb/adb_device_info_query.h |
diff --git a/chrome/browser/devtools/device/adb/adb_device_info_query.h b/chrome/browser/devtools/device/adb/adb_device_info_query.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..675fa0ffdcf1102f23fed997a3cf4b6b60cb7cba |
--- /dev/null |
+++ b/chrome/browser/devtools/device/adb/adb_device_info_query.h |
@@ -0,0 +1,63 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
+#define CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "chrome/browser/devtools/device/android_device_manager.h" |
+ |
+class AdbDeviceInfoQuery : public base::RefCounted<AdbDeviceInfoQuery>, |
+ public base::NonThreadSafe { |
+ public: |
+ static std::string FindDisplayNameByPackage(const std::string& package); |
+ |
+ typedef AndroidDeviceManager::CommandCallback CommandCallback; |
+ typedef AndroidDeviceManager::DeviceInfoCallback DeviceInfoCallback; |
+ |
+ typedef base::Callback< |
+ void(const std::string&, const CommandCallback&)> RunCommandClosure; |
+ |
+ AdbDeviceInfoQuery(const RunCommandClosure& command_closure, |
+ const DeviceInfoCallback& callback); |
+ |
+ |
+ private: |
+ friend class base::RefCounted<AdbDeviceInfoQuery>; |
+ |
+ virtual ~AdbDeviceInfoQuery(); |
+ |
+ void ReceivedModel(int result, const std::string& response); |
+ |
+ void ReceivedDumpsys(int result, const std::string& response); |
+ |
+ void ParseDumpsysResponse(const std::string& response); |
+ |
+ void ParseScreenSize(const std::string& str); |
+ |
+ void ReceivedPackages(int result, const std::string& response); |
+ |
+ void ReceivedProcesses(const std::string& packages_response, |
+ int result, |
+ const std::string& processes_response); |
+ |
+ void ReceivedSockets(const std::string& packages_response, |
+ const std::string& processes_response, |
+ int result, |
+ const std::string& sockets_response); |
+ |
+ void ParseBrowserInfo(const std::string& packages_response, |
+ const std::string& processes_response, |
+ const std::string& sockets_response); |
+ |
+ void Respond(); |
+ |
+ RunCommandClosure command_closure_; |
+ DeviceInfoCallback callback_; |
+ AndroidDeviceManager::DeviceInfo device_info_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AdbDeviceInfoQuery); |
+}; |
+ |
+#endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |