| 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_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/media_request_state.h" | 8 #include "content/public/browser/media_request_state.h" |
| 9 #include "content/public/common/media_stream_request.h" | 9 #include "content/public/common/media_stream_request.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 // An embedder may implement MediaObserver and return it from | 13 // An embedder may implement MediaObserver and return it from |
| 14 // ContentBrowserClient to receive callbacks as media events occur. | 14 // ContentBrowserClient to receive callbacks as media events occur. |
| 15 class MediaObserver { | 15 class MediaObserver { |
| 16 public: | 16 public: |
| 17 // Called when a audio capture device is plugged in or unplugged. | |
| 18 virtual void OnAudioCaptureDevicesChanged( | |
| 19 const MediaStreamDevices& devices) = 0; | |
| 20 | |
| 21 // Called when a video capture device is plugged in or unplugged. | |
| 22 virtual void OnVideoCaptureDevicesChanged( | |
| 23 const MediaStreamDevices& devices) = 0; | |
| 24 | |
| 25 // Called when a media request changes state. | 17 // Called when a media request changes state. |
| 26 virtual void OnMediaRequestStateChanged( | 18 virtual void OnMediaRequestStateChanged( |
| 27 int render_process_id, | 19 int render_process_id, |
| 28 int render_view_id, | 20 int render_view_id, |
| 29 int page_request_id, | 21 int page_request_id, |
| 30 const GURL& security_origin, | 22 const GURL& security_origin, |
| 31 const MediaStreamDevice& device, | 23 const MediaStreamDevice& device, |
| 32 MediaRequestState state) = 0; | 24 MediaRequestState state) = 0; |
| 33 | 25 |
| 34 // Called when an audio stream transitions into a playing or paused state, and | 26 // Called when an audio stream transitions into a playing or paused state, and |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 virtual void OnCreatingAudioStream(int render_process_id, | 40 virtual void OnCreatingAudioStream(int render_process_id, |
| 49 int render_view_id) = 0; | 41 int render_view_id) = 0; |
| 50 | 42 |
| 51 protected: | 43 protected: |
| 52 virtual ~MediaObserver() {} | 44 virtual ~MediaObserver() {} |
| 53 }; | 45 }; |
| 54 | 46 |
| 55 } // namespace content | 47 } // namespace content |
| 56 | 48 |
| 57 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 49 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
| OLD | NEW |