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

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

Issue 1126923002: Add Media Router Mojo impl code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the patch contents. Created 5 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/media_router.h
diff --git a/chrome/browser/media/router/media_router.h b/chrome/browser/media/router/media_router.h
index 3acee0fe8dc2a7839a9b252cc2d3699f45f73340..580c1ce2b71ca80baa645d872fa3b0e8041e7843 100644
--- a/chrome/browser/media/router/media_router.h
+++ b/chrome/browser/media/router/media_router.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/callback.h"
+#include "chrome/browser/media/router/issue.h"
#include "chrome/browser/media/router/media_route.h"
#include "chrome/browser/media/router/media_route_id.h"
#include "chrome/browser/media/router/media_sink.h"
@@ -16,10 +17,11 @@
namespace media_router {
+class IssuesObserver;
class MediaRoutesObserver;
class MediaSinksObserver;
-// Type of callback used in |RequestRoute()|. Callback is invoked when the
+// Type of callback used in |CreateRoute()|. Callback is invoked when the
// route request either succeeded or failed.
// The first argument is the route created. If the route request failed, this
// will be a nullptr.
@@ -38,9 +40,9 @@ class MediaRouter {
// Requests a media route from |source| to |sink_id|.
// |callback| is invoked with a response indicating success or failure.
- virtual void RequestRoute(const MediaSourceId& source,
- const MediaSinkId& sink_id,
- const MediaRouteResponseCallback& callback) = 0;
+ virtual void CreateRoute(const MediaSourceId& source,
+ const MediaSinkId& sink_id,
+ const MediaRouteResponseCallback& callback) = 0;
// Closes the media route specified by |route_id|.
virtual void CloseRoute(const MediaRouteId& route_id) = 0;
@@ -51,6 +53,9 @@ class MediaRouter {
virtual void PostMessage(const MediaRouteId& route_id,
const std::string& message) = 0;
+ // Clears the issue with the id |issue_id|.
+ virtual void ClearIssue(const Issue::IssueId& issue_id) = 0;
+
// Receives updates from a MediaRouter instance.
class Delegate {
public:
@@ -59,13 +64,25 @@ class MediaRouter {
// |message|: The message.
virtual void OnMessage(const MediaRouteId& route_id,
const std::string& message) = 0;
+
+ // Called when there is an issue.
+ // |issue|: The issue.
+ virtual void OnIssue(const Issue& issue) = 0;
};
- protected:
+ // Adds the IssuesObserver |observer|.
mark a. foltz 2015/05/08 00:58:37 Why are there two APIs for callers to be notified
Kevin M 2015/05/12 23:56:09 Yes, OnIssue is redundant. Removed.
+ virtual void AddIssuesObserver(IssuesObserver* observer) = 0;
+
+ // Removes the IssuesObserver |observer|.
+ virtual void RemoveIssuesObserver(IssuesObserver* observer) = 0;
+
+ private:
+ friend class IssuesObserver;
friend class MediaSinksObserver;
friend class MediaRoutesObserver;
+ friend class MediaRouterImpl;
mark a. foltz 2015/05/08 00:58:37 The implementation should not be friended by the i
Kevin M 2015/05/12 23:56:09 Removed. The friend relationship existed to allow
- // The following APIs are called by MediaSinksObserver/MediaRoutesObserver
+ // The following APIs are called by the friend observer classes
mark a. foltz 2015/05/08 00:58:37 I think I would prefer listing the classes specifi
Kevin M 2015/05/12 23:56:09 Done.
// and implementations of MediaRouter only.
// Registers |observer| with this MediaRouter. |observer| specifies a media

Powered by Google App Engine
This is Rietveld 408576698