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

Unified Diff: chrome/browser/media/router/mojo/media_route_controller.h

Issue 2874283002: [Media Router] Notify MRUI of a media status update when it starts observing (Closed)
Patch Set: Created 3 years, 7 months 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/mojo/media_route_controller.h
diff --git a/chrome/browser/media/router/mojo/media_route_controller.h b/chrome/browser/media/router/mojo/media_route_controller.h
index 5a5fab0bc132e11c94d9715cc02d71e9f550a224..ff6e2dc3502a7f76a10ef7cb4242c3820cacb7c5 100644
--- a/chrome/browser/media/router/mojo/media_route_controller.h
+++ b/chrome/browser/media/router/mojo/media_route_controller.h
@@ -44,6 +44,10 @@ class MediaRouteController : public mojom::MediaStatusObserver,
// Removes itself as an observer if |controller_| is still valid.
virtual ~Observer();
+ // Notifies itself with the latest media status that the controller has
+ // received.
+ void CheckForMediaStatusUpdates();
mark a. foltz 2017/05/12 21:00:58 Is this necessary?
takumif 2017/05/12 22:20:58 Removed.
+
virtual void OnMediaStatusUpdated(const MediaStatus& status) = 0;
// Returns a reference to the observed MediaRouteController. The reference
@@ -105,6 +109,10 @@ class MediaRouteController : public mojom::MediaStatusObserver,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ const base::Optional<MediaStatus>& current_media_status() const {
+ return current_media_status_;
+ }
+
// Called when the connection between |this| and the MediaControllerPtr or
// the MediaStatusObserver binding is no longer valid. Notifies
// |media_router_| and |observers_| to dispose their references to |this|.
@@ -129,6 +137,9 @@ class MediaRouteController : public mojom::MediaStatusObserver,
// This becomes false when the controller is invalidated.
bool is_valid_ = true;
+ // The latest media status that the controller has been notified with.
+ base::Optional<MediaStatus> current_media_status_;
+
DISALLOW_COPY_AND_ASSIGN(MediaRouteController);
};

Powered by Google App Engine
This is Rietveld 408576698