Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5634)

Unified Diff: chrome/browser/media/router/presentation_connection_state_observer.h

Issue 1430413003: [Media Router] Connection state change listening redesign part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698