| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ROUTER_MEDIA_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Registers |observer| with this MediaRouter. |observer| specifies a media | 126 // Registers |observer| with this MediaRouter. |observer| specifies a media |
| 127 // source and will receive updates with media sinks that are compatible with | 127 // source and will receive updates with media sinks that are compatible with |
| 128 // that source. The initial update may happen synchronously. | 128 // that source. The initial update may happen synchronously. |
| 129 // NOTE: This class does not assume ownership of |observer|. Callers must | 129 // NOTE: This class does not assume ownership of |observer|. Callers must |
| 130 // manage |observer| and make sure |UnregisterObserver()| is called | 130 // manage |observer| and make sure |UnregisterObserver()| is called |
| 131 // before the observer is destroyed. | 131 // before the observer is destroyed. |
| 132 // It is invalid to register the same observer more than once and will result | 132 // It is invalid to register the same observer more than once and will result |
| 133 // in undefined behavior. | 133 // in undefined behavior. |
| 134 // If the MRPM Host is not available, the registration request will fail | 134 // If the MRPM Host is not available, the registration request will fail |
| 135 // immediately. | 135 // immediately. |
| 136 virtual void RegisterMediaSinksObserver(MediaSinksObserver* observer) = 0; | 136 // The implementation can reject the request to observe in which case it will |
| 137 // notify the caller by returning |false|. |
| 138 virtual bool RegisterMediaSinksObserver(MediaSinksObserver* observer) = 0; |
| 137 | 139 |
| 138 // Removes a previously added MediaSinksObserver. |observer| will stop | 140 // Removes a previously added MediaSinksObserver. |observer| will stop |
| 139 // receiving further updates. | 141 // receiving further updates. |
| 140 virtual void UnregisterMediaSinksObserver(MediaSinksObserver* observer) = 0; | 142 virtual void UnregisterMediaSinksObserver(MediaSinksObserver* observer) = 0; |
| 141 | 143 |
| 142 // Adds a MediaRoutesObserver to listen for updates on MediaRoutes. | 144 // Adds a MediaRoutesObserver to listen for updates on MediaRoutes. |
| 143 // The initial update may happen synchronously. | 145 // The initial update may happen synchronously. |
| 144 // MediaRouter does not own |observer|. |UnregisterMediaRoutesObserver| should | 146 // MediaRouter does not own |observer|. |UnregisterMediaRoutesObserver| should |
| 145 // be called before |observer| is destroyed. | 147 // be called before |observer| is destroyed. |
| 146 // It is invalid to register the same observer more than once and will result | 148 // It is invalid to register the same observer more than once and will result |
| (...skipping 23 matching lines...) Expand all Loading... |
| 170 | 172 |
| 171 // Unregisters a previously registered PresentationSessionMessagesObserver. | 173 // Unregisters a previously registered PresentationSessionMessagesObserver. |
| 172 // |observer| will stop receiving further updates. | 174 // |observer| will stop receiving further updates. |
| 173 virtual void UnregisterPresentationSessionMessagesObserver( | 175 virtual void UnregisterPresentationSessionMessagesObserver( |
| 174 PresentationSessionMessagesObserver* observer) = 0; | 176 PresentationSessionMessagesObserver* observer) = 0; |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 } // namespace media_router | 179 } // namespace media_router |
| 178 | 180 |
| 179 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 181 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |