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

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

Issue 1020743003: [Media Router] Design MediaRouter interface with stub implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move MRPMH::Delegate inheritence from MR to MRImpl Created 5 years, 9 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_sinks_observer.h
diff --git a/chrome/browser/media/router/media_sinks_observer.h b/chrome/browser/media/router/media_sinks_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..0516953694e0b4eb1e3aeba7bdb2a0c90b17462e
--- /dev/null
+++ b/chrome/browser/media/router/media_sinks_observer.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_
+
+#include <map>
Kevin M 2015/03/26 20:50:14 Not needed
imcheng 2015/03/26 23:33:13 Done.
+#include <set>
+#include <vector>
Kevin M 2015/03/26 20:50:15 Not needed
imcheng 2015/03/26 23:33:13 Done.
+
+#include "chrome/browser/media/router/media_route.h"
Kevin M 2015/03/26 20:50:14 Not needed
imcheng 2015/03/26 23:33:13 Done.
+#include "chrome/browser/media/router/media_sink.h"
+#include "chrome/browser/media/router/media_source.h"
+
+namespace media_router {
+
+struct SinksQueryResult {
+ SinksQueryResult();
Kevin M 2015/03/26 20:50:14 No ctor/dtor
imcheng 2015/03/26 23:33:13 Needed by compiler.
+ ~SinksQueryResult();
+
+ std::vector<MediaSink> sinks;
+};
+
+// Interface for observing when the set of sinks compatible with a MediaSource
Kevin M 2015/03/26 20:50:15 "set" => list || collection
imcheng 2015/03/26 23:33:13 Changed to collection.
+// has been updated.
Kevin M 2015/03/26 20:50:14 Can you add a comment about why this is just an in
imcheng 2015/03/26 23:33:13 Added more comments.
+class MediaSinksObserver {
+ public:
+ // Constructs an observer that will observe for sinks compatible
+ // with |source|.
+ explicit MediaSinksObserver(const MediaSource& source) : source_(source) {}
+ virtual ~MediaSinksObserver() {}
+
+ // This function is invoked when the list of sinks compatible
+ // with |source_| has been updated.
+ virtual void OnSinksReceived(const SinksQueryResult& result) = 0;
+
+ const MediaSource& source() const { return source_; }
+
+ private:
+ MediaSource source_;
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698