Chromium Code Reviews| Index: chrome/browser/media/router/presentation_connection_state_observer.h |
| diff --git a/chrome/browser/media/router/presentation_connection_state_observer.h b/chrome/browser/media/router/presentation_connection_state_observer.h |
| index 555f9fed43c06619656532db5584c39a298f102d..a49e60e9a643600ddad005d237b76ae0439b3973 100644 |
| --- a/chrome/browser/media/router/presentation_connection_state_observer.h |
| +++ b/chrome/browser/media/router/presentation_connection_state_observer.h |
| @@ -7,30 +7,39 @@ |
| #include "base/macros.h" |
| #include "chrome/browser/media/router/media_route.h" |
| +#include "content/public/browser/presentation_service_delegate.h" |
| namespace media_router { |
| class MediaRouter; |
| -// Base class for observing state changes on a PresentationConnection. |
| +// Observes state changes on a PresentationConnection and returns the new state |
|
mark a. foltz
2015/11/12 04:19:38
Is the caller expected to find out the current sta
imcheng
2015/11/16 23:52:01
For our current use case, it is not needed. We sta
|
| +// to the supplied PresentationConnectionStateChangedCallback. |
|
mark a. foltz
2015/11/12 04:19:38
Clarify that this callback is run multiple times -
imcheng
2015/11/16 23:52:01
Done in media_router.h.
|
| class PresentationConnectionStateObserver { |
| public: |
| + // |state_changed_cb|: The callback to invoke with state changes. |
| // |router|: The MediaRouter instance to register this instance with. |
| // |route_id|: ID of MediaRoute connected to the PresentationConnection to |
| // be observed. |
| - PresentationConnectionStateObserver(MediaRouter* router, |
| - const MediaRoute::Id& route_id); |
| + PresentationConnectionStateObserver( |
| + const content::PresentationConnectionStateChangedCallback& |
| + state_changed_cb, |
| + const content::PresentationSessionInfo& connection, |
| + const MediaRoute::Id& route_id, |
| + MediaRouter* router); |
| virtual ~PresentationConnectionStateObserver(); |
| MediaRoute::Id route_id() const { return route_id_; } |
| // Invoked when the state of PresentationConnection represented by |route_id_| |
| // has changed to |state|. |
| - virtual void OnStateChanged(content::PresentationConnectionState state) {} |
| + void OnStateChanged(content::PresentationConnectionState state); |
| private: |
| - MediaRouter* const router_; |
| + const content::PresentationConnectionStateChangedCallback state_changed_cb_; |
| + const content::PresentationSessionInfo connection_; |
| const MediaRoute::Id route_id_; |
| + MediaRouter* const router_; |
| DISALLOW_COPY_AND_ASSIGN(PresentationConnectionStateObserver); |
| }; |