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

Side by Side 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 Kevin's comments Created 5 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_
7
8 #include <vector>
9
10 #include "chrome/browser/media/router/media_route.h"
11 #include "chrome/browser/media/router/media_sink.h"
12
13 namespace media_router {
14
15 struct RoutesQueryResult {
xhwang 2015/04/02 17:13:03 Can we just pass two parameters in OnRoutesUpdated
imcheng 2015/04/02 23:05:24 Done.
16 RoutesQueryResult();
17 ~RoutesQueryResult();
18
19 std::vector<MediaRoute> routes;
20 std::vector<MediaSink> sinks;
xhwang 2015/04/02 17:13:03 A MediaRoute has one MediaSource and one MediaSink
imcheng 2015/04/02 23:05:24 Good point. Since we now have MediaSink in MediaRo
21 };
22
23 // Base class for observing when the set of MediaRoutes and their associated
24 // MediaSinks have been updated.
25 class MediaRoutesObserver {
26 public:
27 MediaRoutesObserver();
28 virtual ~MediaRoutesObserver();
29
30 // This function is invoked when the list of routes and their associated
31 // sinks have been updated.
32 virtual void OnRoutesUpdated(const RoutesQueryResult& result) {}
33
34 private:
35 friend class MediaRouterImpl;
36
37 // Whether the observer is registered to the Media Router.
38 // This field will be set by MediaRouterImpl, and must be false by
39 // this instance's destruction. This is used to detect if the observer
40 // is being destroyed while still registered to the Media Router.
41 bool registered_;
42 };
43
44 } // namespace media_router
45
46 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698