| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/devtools/device/android_device_manager.h" | 8 #include "chrome/browser/devtools/device/android_device_manager.h" |
| 9 #include "content/public/browser/web_ui_controller.h" | 9 #include "content/public/browser/web_ui_controller.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 class BrowserContext; | |
| 13 class WebUI; | 12 class WebUI; |
| 14 } | 13 } |
| 15 | 14 |
| 15 class OAuth2TokenService; |
| 16 class Profile; |
| 17 class ProfileIdentityProvider; |
| 18 |
| 16 // Provides access to remote DevTools targets over WebRTC data channel and GCD. | 19 // Provides access to remote DevTools targets over WebRTC data channel and GCD. |
| 17 class WebRTCDeviceProvider final : public AndroidDeviceManager::DeviceProvider { | 20 class WebRTCDeviceProvider final : public AndroidDeviceManager::DeviceProvider { |
| 18 public: | 21 public: |
| 19 /** | 22 /** |
| 20 * Provides resources for provider's background worker. Background worker | 23 * Provides resources for provider's background worker. Background worker |
| 21 * is a windowless page that implements most of functionality of the | 24 * is a windowless page that implements most of functionality of the |
| 22 * provider. It sandboxes WebRTC connections with remote devices and other | 25 * provider. It sandboxes WebRTC connections with remote devices and other |
| 23 * provider implementation details. | 26 * provider implementation details. |
| 24 */ | 27 */ |
| 25 class WebUI : public content::WebUIController { | 28 class WebUI : public content::WebUIController { |
| 26 public: | 29 public: |
| 27 explicit WebUI(content::WebUI* web_ui); | 30 explicit WebUI(content::WebUI* web_ui); |
| 28 ~WebUI() override; | 31 ~WebUI() override; |
| 29 }; | 32 }; |
| 30 | 33 |
| 31 explicit WebRTCDeviceProvider(content::BrowserContext* context); | 34 WebRTCDeviceProvider(Profile* profile, |
| 35 ProfileIdentityProvider* identity_provider); |
| 32 | 36 |
| 33 // AndroidDeviceManager::DeviceProvider implementation. | 37 // AndroidDeviceManager::DeviceProvider implementation. |
| 34 void QueryDevices(const SerialsCallback& callback) override; | 38 void QueryDevices(const SerialsCallback& callback) override; |
| 35 | 39 |
| 36 void QueryDeviceInfo(const std::string& serial, | 40 void QueryDeviceInfo(const std::string& serial, |
| 37 const DeviceInfoCallback& callback) override; | 41 const DeviceInfoCallback& callback) override; |
| 38 | 42 |
| 39 void OpenSocket(const std::string& serial, | 43 void OpenSocket(const std::string& serial, |
| 40 const std::string& socket_name, | 44 const std::string& socket_name, |
| 41 const SocketCallback& callback) override; | 45 const SocketCallback& callback) override; |
| 42 | 46 |
| 43 private: | 47 private: |
| 48 class DevToolsBridgeClient; |
| 49 class MessageHandler; |
| 50 |
| 44 ~WebRTCDeviceProvider() override; | 51 ~WebRTCDeviceProvider() override; |
| 45 | 52 |
| 46 scoped_ptr<content::WebContents> background_worker_; | 53 const base::WeakPtr<DevToolsBridgeClient> client_; |
| 47 | 54 |
| 48 DISALLOW_COPY_AND_ASSIGN(WebRTCDeviceProvider); | 55 DISALLOW_COPY_AND_ASSIGN(WebRTCDeviceProvider); |
| 49 }; | 56 }; |
| 50 | 57 |
| 51 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ | 58 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |
| OLD | NEW |