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

Unified Diff: chrome/browser/devtools/device/adb/adb_device_info_query.h

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
« no previous file with comments | « no previous file | chrome/browser/devtools/device/adb/adb_device_info_query.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..881859515b67ae1cd38eb87c107975d3bb7357b1
--- /dev/null
+++ b/chrome/browser/devtools/device/adb/adb_device_info_query.h
@@ -0,0 +1,66 @@
+// 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/threading/non_thread_safe.h"
+#include "chrome/browser/devtools/device/android_device_manager.h"
+
+class AdbDeviceInfoQuery : public base::NonThreadSafe {
+ public:
+ static AndroidDeviceManager::BrowserInfo::Type GetBrowserType(
+ const std::string& socket);
+
+ static std::string GetDisplayName(const std::string& socket,
+ const std::string& package);
+
+ typedef AndroidDeviceManager::CommandCallback CommandCallback;
+ typedef AndroidDeviceManager::DeviceInfoCallback DeviceInfoCallback;
+
+ typedef base::Callback<
+ void(const std::string&, const CommandCallback&)> RunCommandCallback;
+
+ static void Start(const RunCommandCallback& command_callback,
+ const DeviceInfoCallback& callback);
+
+ private:
+ AdbDeviceInfoQuery(const RunCommandCallback& command_callback,
+ const DeviceInfoCallback& callback);
+
+ 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();
+
+ RunCommandCallback command_callback_;
+ DeviceInfoCallback callback_;
+ AndroidDeviceManager::DeviceInfo device_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(AdbDeviceInfoQuery);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ADB_ADB_DEVICE_INFO_QUERY_H_
« no previous file with comments | « no previous file | chrome/browser/devtools/device/adb/adb_device_info_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698