Chromium Code Reviews| Index: chrome/browser/devtools/device/webrtc/webrtc_device_provider.h |
| diff --git a/chrome/browser/devtools/device/webrtc/webrtc_device_provider.h b/chrome/browser/devtools/device/webrtc/webrtc_device_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5521b439d5f111d3192ae22a4224a82c32dd027b |
| --- /dev/null |
| +++ b/chrome/browser/devtools/device/webrtc/webrtc_device_provider.h |
| @@ -0,0 +1,58 @@ |
| +// 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_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |
| +#define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |
| + |
| +#include "chrome/browser/devtools/device/android_device_manager.h" |
| +#include "content/public/browser/web_ui_controller.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +class WebUI; |
| +} |
| + |
| +// Provides remote Clank instances using WebRTC data channel and GCD. |
|
dgozman
2014/11/27 13:45:27
Not Clank, but any components/devtools_bridge embe
SeRya
2014/11/27 14:15:09
So far our primary goal is Clank. I think specific
|
| +class WebRTCDeviceProvider final : public AndroidDeviceManager::DeviceProvider { |
| + public: |
| + class MessageHandler; |
| + |
| + /** |
| + * Provides resources for provider's background worker. Background worker |
| + * is a windowless page what implements most of functionality of the |
|
dgozman
2014/11/27 13:45:27
typo: what->that
SeRya
2014/11/27 14:15:09
Done.
|
| + * provider. It sandboxes WebRTC connections with remote devices and other |
| + * provider implementation details. |
| + */ |
| + class WebUI : public content::WebUIController { |
| + public: |
| + explicit WebUI(content::WebUI* web_ui); |
| + ~WebUI() override; |
| + |
| + private: |
| + friend class WebRTCDeviceProvider; |
| + |
| + scoped_ptr<MessageHandler> const handler_; |
| + }; |
| + |
| + explicit WebRTCDeviceProvider(content::BrowserContext* context); |
| + |
| + void QueryDevices(const SerialsCallback& callback) override; |
| + |
| + void QueryDeviceInfo(const std::string& serial, |
| + const DeviceInfoCallback& callback) override; |
| + |
| + void OpenSocket(const std::string& serial, |
| + const std::string& socket_name, |
| + const SocketCallback& callback) override; |
| + |
| + private: |
| + ~WebRTCDeviceProvider(); |
| + |
| + scoped_ptr<content::WebContents> background_worker_; |
| + MessageHandler* handler_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebRTCDeviceProvider); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_WEBRTC_DEVICE_PROVIDER_H_ |