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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« 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