| 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" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const content::MediaStreamDevice& device, | 55 const content::MediaStreamDevice& device, |
| 56 content::MediaRequestState state) OVERRIDE; | 56 content::MediaRequestState state) OVERRIDE; |
| 57 | 57 |
| 58 // Methods for observers. | 58 // Methods for observers. |
| 59 // Observers should add themselves on construction and remove themselves | 59 // Observers should add themselves on construction and remove themselves |
| 60 // on destruction. | 60 // on destruction. |
| 61 void AddObserver(MediaInternalsObserver* observer); | 61 void AddObserver(MediaInternalsObserver* observer); |
| 62 void RemoveObserver(MediaInternalsObserver* observer); | 62 void RemoveObserver(MediaInternalsObserver* observer); |
| 63 void SendEverything(); | 63 void SendEverything(); |
| 64 | 64 |
| 65 scoped_refptr<MediaStreamCaptureIndicator> GetMediaStreamCaptureIndicator(); |
| 66 |
| 65 private: | 67 private: |
| 66 friend class MediaInternalsTest; | 68 friend class MediaInternalsTest; |
| 67 friend struct DefaultSingletonTraits<MediaInternals>; | 69 friend struct DefaultSingletonTraits<MediaInternals>; |
| 68 | 70 |
| 69 MediaInternals(); | 71 MediaInternals(); |
| 70 | 72 |
| 71 // Sets |property| of an audio stream to |value| and notifies observers. | 73 // Sets |property| of an audio stream to |value| and notifies observers. |
| 72 // (host, stream_id) is a unique id for the audio stream. | 74 // (host, stream_id) is a unique id for the audio stream. |
| 73 // |host| will never be dereferenced. | 75 // |host| will never be dereferenced. |
| 74 void UpdateAudioStream(void* host, int stream_id, | 76 void UpdateAudioStream(void* host, int stream_id, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 86 void SendUpdate(const std::string& function, Value* value); | 88 void SendUpdate(const std::string& function, Value* value); |
| 87 | 89 |
| 88 DictionaryValue data_; | 90 DictionaryValue data_; |
| 89 ObserverList<MediaInternalsObserver> observers_; | 91 ObserverList<MediaInternalsObserver> observers_; |
| 90 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; | 92 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(MediaInternals); | 94 DISALLOW_COPY_AND_ASSIGN(MediaInternals); |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 #endif // CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ | 97 #endif // CHROME_BROWSER_MEDIA_MEDIA_INTERNALS_H_ |
| OLD | NEW |