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_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "chrome/browser/devtools/device/android_device_manager.h" | |
10 #include "content/public/browser/web_ui_controller.h" | |
11 | |
12 namespace content { | |
13 class WebUI; | |
14 } | |
15 | |
16 class DevToolsBridgeClient; | |
17 class OAuth2TokenService; | |
18 class Profile; | |
19 class ProfileOAuth2TokenService; | |
20 class SigninManagerBase; | |
21 | |
22 // Provides access to remote DevTools targets over WebRTC data channel and GCD. | |
23 class WebRTCDeviceProvider final : public AndroidDeviceManager::DeviceProvider { | |
24 public: | |
25 /** | |
26 * Provides resources for provider's background worker. Background worker | |
27 * is a windowless page that implements most of functionality of the | |
28 * provider. It sandboxes WebRTC connections with remote devices and other | |
29 * provider implementation details. | |
30 */ | |
31 class WebUI : public content::WebUIController { | |
32 public: | |
33 explicit WebUI(content::WebUI* web_ui); | |
34 ~WebUI() override; | |
35 }; | |
36 | |
37 WebRTCDeviceProvider(Profile* profile, | |
38 SigninManagerBase* signin_manager, | |
39 ProfileOAuth2TokenService* token_service); | |
40 | |
41 // AndroidDeviceManager::DeviceProvider implementation. | |
42 void QueryDevices(const SerialsCallback& callback) override; | |
43 | |
44 void QueryDeviceInfo(const std::string& serial, | |
45 const DeviceInfoCallback& callback) override; | |
46 | |
47 void OpenSocket(const std::string& serial, | |
48 const std::string& socket_name, | |
49 const SocketCallback& callback) override; | |
50 | |
51 private: | |
52 ~WebRTCDeviceProvider() override; | |
53 | |
54 const base::WeakPtr<DevToolsBridgeClient> client_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(WebRTCDeviceProvider); | |
57 }; | |
58 | |
59 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | |
OLD | NEW |