OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" | 11 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" |
12 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 12 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
13 #include "webkit/plugins/ppapi/plugin_delegate.h" | 13 #include "webkit/plugins/ppapi/plugin_delegate.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 class PepperDeviceEnumerationEventHandler | 17 class PepperDeviceEnumerationEventHandler |
18 : public MediaStreamDispatcherEventHandler, | 18 : public MediaStreamDispatcherEventHandler, |
19 public base::SupportsWeakPtr<PepperDeviceEnumerationEventHandler> { | 19 public base::SupportsWeakPtr<PepperDeviceEnumerationEventHandler> { |
20 public: | 20 public: |
21 PepperDeviceEnumerationEventHandler(); | 21 PepperDeviceEnumerationEventHandler(); |
22 virtual ~PepperDeviceEnumerationEventHandler(); | 22 virtual ~PepperDeviceEnumerationEventHandler(); |
23 | 23 |
24 int RegisterEnumerateDevicesCallback( | 24 int RegisterEnumerateDevicesCallback( |
25 const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback); | 25 const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback); |
| 26 int UnregisterEnumerateDevicesCallback(int request_id); |
26 | 27 |
27 int RegisterOpenDeviceCallback( | 28 int RegisterOpenDeviceCallback( |
28 const PepperPluginDelegateImpl::OpenDeviceCallback& callback); | 29 const PepperPluginDelegateImpl::OpenDeviceCallback& callback); |
29 | 30 |
30 // MediaStreamDispatcherEventHandler implementation. | 31 // MediaStreamDispatcherEventHandler implementation. |
31 virtual void OnStreamGenerated( | 32 virtual void OnStreamGenerated( |
32 int request_id, | 33 int request_id, |
33 const std::string& label, | 34 const std::string& label, |
34 const media_stream::StreamDeviceInfoArray& audio_device_array, | 35 const media_stream::StreamDeviceInfoArray& audio_device_array, |
35 const media_stream::StreamDeviceInfoArray& video_device_array) OVERRIDE; | 36 const media_stream::StreamDeviceInfoArray& video_device_array) OVERRIDE; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 typedef std::map<int, PepperPluginDelegateImpl::OpenDeviceCallback> | 75 typedef std::map<int, PepperPluginDelegateImpl::OpenDeviceCallback> |
75 OpenCallbackMap; | 76 OpenCallbackMap; |
76 OpenCallbackMap open_callbacks_; | 77 OpenCallbackMap open_callbacks_; |
77 | 78 |
78 DISALLOW_COPY_AND_ASSIGN(PepperDeviceEnumerationEventHandler); | 79 DISALLOW_COPY_AND_ASSIGN(PepperDeviceEnumerationEventHandler); |
79 }; | 80 }; |
80 | 81 |
81 } // namespace content | 82 } // namespace content |
82 | 83 |
83 #endif // CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ | 84 #endif // CONTENT_RENDERER_PEPPER_PEPPER_DEVICE_ENUMERATION_EVENT_HANDLER_H_ |
OLD | NEW |