| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void OnStreamGenerated(int request_id, |
| 73 int request_id, | 73 const std::string& label, |
| 74 const std::string& label, | 74 const StreamDeviceInfoArray& audio_array, |
| 75 const StreamDeviceInfoArray& audio_array, | 75 const StreamDeviceInfoArray& video_array) override; |
| 76 const StreamDeviceInfoArray& video_array) override; | 76 void OnStreamGenerationFailed(int request_id, |
| 77 virtual void OnStreamGenerationFailed( | 77 MediaStreamRequestResult result) override; |
| 78 int request_id, | 78 void OnDeviceStopped(const std::string& label, |
| 79 MediaStreamRequestResult result) override; | 79 const StreamDeviceInfo& device_info) override; |
| 80 virtual void OnDeviceStopped(const std::string& label, | 80 void OnDevicesEnumerated(int request_id, |
| 81 const StreamDeviceInfo& device_info) override; | 81 const StreamDeviceInfoArray& device_array) override; |
| 82 virtual void OnDevicesEnumerated( | 82 void OnDeviceOpened(int request_id, |
| 83 int request_id, | 83 const std::string& label, |
| 84 const StreamDeviceInfoArray& device_array) override; | 84 const StreamDeviceInfo& device_info) override; |
| 85 virtual void OnDeviceOpened( | 85 void OnDeviceOpenFailed(int request_id) override; |
| 86 int request_id, | |
| 87 const std::string& label, | |
| 88 const StreamDeviceInfo& device_info) override; | |
| 89 virtual void OnDeviceOpenFailed(int request_id) override; | |
| 90 | 86 |
| 91 // RenderFrameObserver override | 87 // RenderFrameObserver override |
| 92 virtual void FrameWillClose() override; | 88 void FrameWillClose() override; |
| 93 | 89 |
| 94 protected: | 90 protected: |
| 95 // Called when |source| has been stopped from JavaScript. | 91 // Called when |source| has been stopped from JavaScript. |
| 96 void OnLocalSourceStopped(const blink::WebMediaStreamSource& source); | 92 void OnLocalSourceStopped(const blink::WebMediaStreamSource& source); |
| 97 | 93 |
| 98 // These methods are virtual for test purposes. A test can override them to | 94 // 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 | 95 // test requesting local media streams. The function notifies WebKit that the |
| 100 // |request| have completed. | 96 // |request| have completed. |
| 101 virtual void GetUserMediaRequestSucceeded( | 97 virtual void GetUserMediaRequestSucceeded( |
| 102 const blink::WebMediaStream& stream, | 98 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 | 249 // Note: This member must be the last to ensure all outstanding weak pointers |
| 254 // are invalidated first. | 250 // are invalidated first. |
| 255 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; | 251 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; |
| 256 | 252 |
| 257 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); | 253 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); |
| 258 }; | 254 }; |
| 259 | 255 |
| 260 } // namespace content | 256 } // namespace content |
| 261 | 257 |
| 262 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 258 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
| OLD | NEW |