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_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 MediaStreamDispatcher* media_stream_dispatcher() const { | 55 MediaStreamDispatcher* media_stream_dispatcher() const { |
56 return media_stream_dispatcher_.get(); | 56 return media_stream_dispatcher_.get(); |
57 } | 57 } |
58 | 58 |
59 // blink::WebUserMediaClient implementation | 59 // blink::WebUserMediaClient implementation |
60 virtual void requestUserMedia( | 60 virtual void requestUserMedia( |
61 const blink::WebUserMediaRequest& user_media_request); | 61 const blink::WebUserMediaRequest& user_media_request); |
62 virtual void cancelUserMediaRequest( | 62 virtual void cancelUserMediaRequest( |
63 const blink::WebUserMediaRequest& user_media_request); | 63 const blink::WebUserMediaRequest& user_media_request); |
64 virtual void requestMediaDevices( | 64 virtual void requestMediaDevices( |
65 const blink::WebMediaDevicesRequest& media_devices_request) OVERRIDE; | 65 const blink::WebMediaDevicesRequest& media_devices_request) override; |
66 virtual void cancelMediaDevicesRequest( | 66 virtual void cancelMediaDevicesRequest( |
67 const blink::WebMediaDevicesRequest& media_devices_request) OVERRIDE; | 67 const blink::WebMediaDevicesRequest& media_devices_request) override; |
68 virtual void requestSources( | 68 virtual void requestSources( |
69 const blink::WebMediaStreamTrackSourcesRequest& sources_request) OVERRIDE; | 69 const blink::WebMediaStreamTrackSourcesRequest& sources_request) override; |
70 | 70 |
71 // MediaStreamDispatcherEventHandler implementation. | 71 // MediaStreamDispatcherEventHandler implementation. |
72 virtual void OnStreamGenerated( | 72 virtual void OnStreamGenerated( |
73 int request_id, | 73 int request_id, |
74 const std::string& label, | 74 const std::string& label, |
75 const StreamDeviceInfoArray& audio_array, | 75 const StreamDeviceInfoArray& audio_array, |
76 const StreamDeviceInfoArray& video_array) OVERRIDE; | 76 const StreamDeviceInfoArray& video_array) override; |
77 virtual void OnStreamGenerationFailed( | 77 virtual void OnStreamGenerationFailed( |
78 int request_id, | 78 int request_id, |
79 MediaStreamRequestResult result) OVERRIDE; | 79 MediaStreamRequestResult result) override; |
80 virtual void OnDeviceStopped(const std::string& label, | 80 virtual void OnDeviceStopped(const std::string& label, |
81 const StreamDeviceInfo& device_info) OVERRIDE; | 81 const StreamDeviceInfo& device_info) override; |
82 virtual void OnDevicesEnumerated( | 82 virtual void OnDevicesEnumerated( |
83 int request_id, | 83 int request_id, |
84 const StreamDeviceInfoArray& device_array) OVERRIDE; | 84 const StreamDeviceInfoArray& device_array) override; |
85 virtual void OnDeviceOpened( | 85 virtual void OnDeviceOpened( |
86 int request_id, | 86 int request_id, |
87 const std::string& label, | 87 const std::string& label, |
88 const StreamDeviceInfo& device_info) OVERRIDE; | 88 const StreamDeviceInfo& device_info) override; |
89 virtual void OnDeviceOpenFailed(int request_id) OVERRIDE; | 89 virtual void OnDeviceOpenFailed(int request_id) override; |
90 | 90 |
91 // RenderFrameObserver OVERRIDE | 91 // RenderFrameObserver override |
92 virtual void FrameWillClose() OVERRIDE; | 92 virtual void FrameWillClose() override; |
93 | 93 |
94 protected: | 94 protected: |
95 // Called when |source| has been stopped from JavaScript. | 95 // Called when |source| has been stopped from JavaScript. |
96 void OnLocalSourceStopped(const blink::WebMediaStreamSource& source); | 96 void OnLocalSourceStopped(const blink::WebMediaStreamSource& source); |
97 | 97 |
98 // These methods are virtual for test purposes. A test can override them to | 98 // These methods are virtual for test purposes. A test can override them to |
99 // test requesting local media streams. The function notifies WebKit that the | 99 // test requesting local media streams. The function notifies WebKit that the |
100 // |request| have completed. | 100 // |request| have completed. |
101 virtual void GetUserMediaRequestSucceeded( | 101 virtual void GetUserMediaRequestSucceeded( |
102 const blink::WebMediaStream& stream, | 102 const blink::WebMediaStream& stream, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Note: This member must be the last to ensure all outstanding weak pointers | 253 // Note: This member must be the last to ensure all outstanding weak pointers |
254 // are invalidated first. | 254 // are invalidated first. |
255 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; | 255 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; |
256 | 256 |
257 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); | 257 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); |
258 }; | 258 }; |
259 | 259 |
260 } // namespace content | 260 } // namespace content |
261 | 261 |
262 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 262 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
OLD | NEW |