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