OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/devtools/device/android_device_manager.h" |
| 10 |
| 11 class AdbDeviceInfoQuery : public base::RefCounted<AdbDeviceInfoQuery>, |
| 12 public base::NonThreadSafe { |
| 13 public: |
| 14 static std::string FindDisplayNameByPackage(const std::string& package); |
| 15 |
| 16 typedef AndroidDeviceManager::CommandCallback CommandCallback; |
| 17 typedef AndroidDeviceManager::DeviceInfoCallback DeviceInfoCallback; |
| 18 |
| 19 typedef base::Callback< |
| 20 void(const std::string&, const CommandCallback&)> RunCommandClosure; |
| 21 |
| 22 AdbDeviceInfoQuery(const RunCommandClosure& command_closure, |
| 23 const DeviceInfoCallback& callback); |
| 24 |
| 25 |
| 26 private: |
| 27 friend class base::RefCounted<AdbDeviceInfoQuery>; |
| 28 |
| 29 virtual ~AdbDeviceInfoQuery(); |
| 30 |
| 31 void ReceivedModel(int result, const std::string& response); |
| 32 |
| 33 void ReceivedDumpsys(int result, const std::string& response); |
| 34 |
| 35 void ParseDumpsysResponse(const std::string& response); |
| 36 |
| 37 void ParseScreenSize(const std::string& str); |
| 38 |
| 39 void ReceivedPackages(int result, const std::string& response); |
| 40 |
| 41 void ReceivedProcesses(const std::string& packages_response, |
| 42 int result, |
| 43 const std::string& processes_response); |
| 44 |
| 45 void ReceivedSockets(const std::string& packages_response, |
| 46 const std::string& processes_response, |
| 47 int result, |
| 48 const std::string& sockets_response); |
| 49 |
| 50 void ParseBrowserInfo(const std::string& packages_response, |
| 51 const std::string& processes_response, |
| 52 const std::string& sockets_response); |
| 53 |
| 54 void Respond(); |
| 55 |
| 56 RunCommandClosure command_closure_; |
| 57 DeviceInfoCallback callback_; |
| 58 AndroidDeviceManager::DeviceInfo device_info_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(AdbDeviceInfoQuery); |
| 61 }; |
| 62 |
| 63 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
OLD | NEW |