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 CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "content/public/browser/media_observer.h" | 12 #include "content/public/browser/media_observer.h" |
| 13 #include "content/public/common/media_stream_request.h" |
13 | 14 |
14 class MediaInternalsObserver; | 15 class MediaInternalsObserver; |
15 class MediaStreamCaptureIndicator; | 16 class MediaStreamCaptureIndicator; |
16 | 17 |
17 namespace media { | 18 namespace media { |
18 struct MediaLogEvent; | 19 struct MediaLogEvent; |
19 } | 20 } |
20 | 21 |
21 // This class stores information about currently active media. | 22 // This class stores information about currently active media. |
22 // It's constructed on the UI thread but all of its methods are called on the IO | 23 // It's constructed on the UI thread but all of its methods are called on the IO |
(...skipping 18 matching lines...) Expand all Loading... |
41 virtual void OnMediaEvent(int render_process_id, | 42 virtual void OnMediaEvent(int render_process_id, |
42 const media::MediaLogEvent& event) OVERRIDE; | 43 const media::MediaLogEvent& event) OVERRIDE; |
43 virtual void OnCaptureDevicesOpened( | 44 virtual void OnCaptureDevicesOpened( |
44 int render_process_id, | 45 int render_process_id, |
45 int render_view_id, | 46 int render_view_id, |
46 const content::MediaStreamDevices& devices) OVERRIDE; | 47 const content::MediaStreamDevices& devices) OVERRIDE; |
47 virtual void OnCaptureDevicesClosed( | 48 virtual void OnCaptureDevicesClosed( |
48 int render_process_id, | 49 int render_process_id, |
49 int render_view_id, | 50 int render_view_id, |
50 const content::MediaStreamDevices& devices) OVERRIDE; | 51 const content::MediaStreamDevices& devices) OVERRIDE; |
| 52 virtual void OnMediaRequestStateChange( |
| 53 int render_process_id, |
| 54 int render_view_id, |
| 55 const content::MediaStreamDevice& device, |
| 56 const content::MediaStreamRequest::RequestState state) OVERRIDE; |
51 | 57 |
52 // Methods for observers. | 58 // Methods for observers. |
53 // Observers should add themselves on construction and remove themselves | 59 // Observers should add themselves on construction and remove themselves |
54 // on destruction. | 60 // on destruction. |
55 void AddObserver(MediaInternalsObserver* observer); | 61 void AddObserver(MediaInternalsObserver* observer); |
56 void RemoveObserver(MediaInternalsObserver* observer); | 62 void RemoveObserver(MediaInternalsObserver* observer); |
57 void SendEverything(); | 63 void SendEverything(); |
58 | 64 |
59 private: | 65 private: |
60 friend class MediaInternalsTest; | 66 friend class MediaInternalsTest; |
(...skipping 19 matching lines...) Expand all Loading... |
80 void SendUpdate(const std::string& function, Value* value); | 86 void SendUpdate(const std::string& function, Value* value); |
81 | 87 |
82 DictionaryValue data_; | 88 DictionaryValue data_; |
83 ObserverList<MediaInternalsObserver> observers_; | 89 ObserverList<MediaInternalsObserver> observers_; |
84 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; | 90 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; |
85 | 91 |
86 DISALLOW_COPY_AND_ASSIGN(MediaInternals); | 92 DISALLOW_COPY_AND_ASSIGN(MediaInternals); |
87 }; | 93 }; |
88 | 94 |
89 #endif // CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ | 95 #endif // CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ |
OLD | NEW |