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/threading/non_thread_safe.h" |
| 9 #include "chrome/browser/devtools/device/android_device_manager.h" |
| 10 |
| 11 class AdbDeviceInfoQuery : public base::NonThreadSafe { |
| 12 public: |
| 13 static AndroidDeviceManager::BrowserInfo::Type GetBrowserType( |
| 14 const std::string& socket); |
| 15 |
| 16 static std::string GetDisplayName(const std::string& socket, |
| 17 const std::string& package); |
| 18 |
| 19 typedef AndroidDeviceManager::CommandCallback CommandCallback; |
| 20 typedef AndroidDeviceManager::DeviceInfoCallback DeviceInfoCallback; |
| 21 |
| 22 typedef base::Callback< |
| 23 void(const std::string&, const CommandCallback&)> RunCommandCallback; |
| 24 |
| 25 static void Start(const RunCommandCallback& command_callback, |
| 26 const DeviceInfoCallback& callback); |
| 27 |
| 28 private: |
| 29 AdbDeviceInfoQuery(const RunCommandCallback& command_callback, |
| 30 const DeviceInfoCallback& callback); |
| 31 |
| 32 virtual ~AdbDeviceInfoQuery(); |
| 33 |
| 34 void ReceivedModel(int result, const std::string& response); |
| 35 |
| 36 void ReceivedDumpsys(int result, const std::string& response); |
| 37 |
| 38 void ParseDumpsysResponse(const std::string& response); |
| 39 |
| 40 void ParseScreenSize(const std::string& str); |
| 41 |
| 42 void ReceivedPackages(int result, const std::string& response); |
| 43 |
| 44 void ReceivedProcesses(const std::string& packages_response, |
| 45 int result, |
| 46 const std::string& processes_response); |
| 47 |
| 48 void ReceivedSockets(const std::string& packages_response, |
| 49 const std::string& processes_response, |
| 50 int result, |
| 51 const std::string& sockets_response); |
| 52 |
| 53 void ParseBrowserInfo(const std::string& packages_response, |
| 54 const std::string& processes_response, |
| 55 const std::string& sockets_response); |
| 56 |
| 57 void Respond(); |
| 58 |
| 59 RunCommandCallback command_callback_; |
| 60 DeviceInfoCallback callback_; |
| 61 AndroidDeviceManager::DeviceInfo device_info_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(AdbDeviceInfoQuery); |
| 64 }; |
| 65 |
| 66 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_ |
OLD | NEW |