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

Unified Diff: chrome/browser/media/router/media_routes_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: Addressed mark's comments 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_routes_observer.h
diff --git a/chrome/browser/media/router/media_routes_observer.h b/chrome/browser/media/router/media_routes_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..6fc988381b2c6bf923b7afb365e2cb37406062fe
--- /dev/null
+++ b/chrome/browser/media/router/media_routes_observer.h
@@ -0,0 +1,44 @@
+// 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_ROUTES_OBSERVER_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_
+
+#include <vector>
+
+#include "chrome/browser/media/router/media_route.h"
+#include "chrome/browser/media/router/media_sink.h"
+
+namespace media_router {
+
+struct RoutesQueryResult {
+ RoutesQueryResult();
+ ~RoutesQueryResult();
+
+ std::vector<MediaRoute> routes;
+ std::vector<MediaSink> sinks;
+};
+
+// Base class for observing when the set of MediaRoutes and their associated
+// MediaSinks have been updated.
+class MediaRoutesObserver {
+ public:
+ MediaRoutesObserver();
+ virtual ~MediaRoutesObserver();
+
+ // This function is invoked when the list of routes and their associated
+ // sinks have been updated.
+ virtual void OnRoutesUpdated(const RoutesQueryResult& result) {}
+
+ private:
+ friend class MediaRouterImpl;
+
+ // This field will be set by MediaRouterImpl, and must be false by
Kevin Marshall 2015/04/01 17:00:19 Can you describe the purpose of this field too? A
imcheng 2015/04/01 18:10:09 Add documentation. The bit will be set by MediaRou
+ // this instance's destruction.
+ bool registered_;
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698