| 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_PRESENTATION_SESSION_STATE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SESSION_STATE_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SESSION_STATE_OBSERVER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SESSION_STATE_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // Clears the set of presentations being tracked. | 41 // Clears the set of presentations being tracked. |
| 42 void Reset(); | 42 void Reset(); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 FRIEND_TEST_ALL_PREFIXES(PresentationSessionStateObserverTest, | 45 FRIEND_TEST_ALL_PREFIXES(PresentationSessionStateObserverTest, |
| 46 InvokeCallbackWithDisconnected); | 46 InvokeCallbackWithDisconnected); |
| 47 FRIEND_TEST_ALL_PREFIXES(PresentationSessionStateObserverTest, Reset); | 47 FRIEND_TEST_ALL_PREFIXES(PresentationSessionStateObserverTest, Reset); |
| 48 | 48 |
| 49 // MediaRoutesObserver override | 49 // MediaRoutesObserver override |
| 50 void OnRoutesUpdated(const std::vector<MediaRoute>& routes) override; | 50 void OnRoutesUpdated(const std::vector<MediaRoute>& routes, |
| 51 const std::vector<MediaRoute::Id>& joinable_route_ids) override; |
| 51 | 52 |
| 52 // Invokes |state_changed_callback_| with PresentationSessionInfo derived from | 53 // Invokes |state_changed_callback_| with PresentationSessionInfo derived from |
| 53 // |route_id| and |new_state|, if |route_id| is valid. | 54 // |route_id| and |new_state|, if |route_id| is valid. |
| 54 void InvokeCallback(const MediaRoute::Id& route_id, | 55 void InvokeCallback(const MediaRoute::Id& route_id, |
| 55 content::PresentationSessionState new_state); | 56 content::PresentationSessionState new_state); |
| 56 | 57 |
| 57 // Route IDs of presentations that are being tracked for state changes. | 58 // Route IDs of presentations that are being tracked for state changes. |
| 58 // It is built by adding entries when a presentation is started, | 59 // It is built by adding entries when a presentation is started, |
| 59 // and removing entries when the presentation is no longer in subsequent | 60 // and removing entries when the presentation is no longer in subsequent |
| 60 // route list updates. | 61 // route list updates. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 74 // it, its contents can be changed by the PresentationFrame that owns it. | 75 // it, its contents can be changed by the PresentationFrame that owns it. |
| 75 const MediaRouteIdToPresentationSessionMapping* const | 76 const MediaRouteIdToPresentationSessionMapping* const |
| 76 route_id_to_presentation_; | 77 route_id_to_presentation_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(PresentationSessionStateObserver); | 79 DISALLOW_COPY_AND_ASSIGN(PresentationSessionStateObserver); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace media_router | 82 } // namespace media_router |
| 82 | 83 |
| 83 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SESSION_STATE_OBSERVER_H_ | 84 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SESSION_STATE_OBSERVER_H_ |
| OLD | NEW |