OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "chrome/common/media_router/media_route.h" | 14 #include "chrome/common/media_router/media_route.h" |
15 #include "content/public/common/presentation_connection_message.h" | |
takumif
2017/06/26 18:50:15
Can we forward-declare this instead?
imcheng
2017/06/27 06:41:57
Done.
| |
15 | 16 |
16 namespace media_router { | 17 namespace media_router { |
17 | 18 |
18 class MediaRouter; | 19 class MediaRouter; |
19 struct RouteMessage; | |
20 | 20 |
21 // Observes messages originating from the MediaSink connected to a MediaRoute. | 21 // Observes messages originating from the MediaSink connected to a MediaRoute. |
22 // Messages are received from MediaRouter via |OnMessagesReceived|. | 22 // Messages are received from MediaRouter via |OnMessagesReceived|. |
23 class RouteMessageObserver { | 23 class RouteMessageObserver { |
takumif
2017/06/26 18:50:15
Maybe we should add a TODO to rename this to Prese
imcheng
2017/06/27 06:41:57
Done.
| |
24 public: | 24 public: |
25 // |route_id|: ID of MediaRoute to listen for messages. | 25 // |route_id|: ID of MediaRoute to listen for messages. |
26 RouteMessageObserver(MediaRouter* router, const MediaRoute::Id& route_id); | 26 RouteMessageObserver(MediaRouter* router, const MediaRoute::Id& route_id); |
27 | 27 |
28 virtual ~RouteMessageObserver(); | 28 virtual ~RouteMessageObserver(); |
29 | 29 |
30 // Invoked by |router_| whenever messages are received from the route sink. | 30 // Invoked by |router_| whenever messages are received from the route sink. |
31 // |messages| is guaranteed to be non-empty. | 31 // |messages| is guaranteed to be non-empty. |
32 virtual void OnMessagesReceived( | 32 virtual void OnMessagesReceived( |
33 const std::vector<RouteMessage>& messages) = 0; | 33 const std::vector<content::PresentationConnectionMessage>& messages) = 0; |
34 | 34 |
35 const MediaRoute::Id& route_id() const { return route_id_; } | 35 const MediaRoute::Id& route_id() const { return route_id_; } |
36 | 36 |
37 private: | 37 private: |
38 MediaRouter* const router_; | 38 MediaRouter* const router_; |
39 const MediaRoute::Id route_id_; | 39 const MediaRoute::Id route_id_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(RouteMessageObserver); | 41 DISALLOW_COPY_AND_ASSIGN(RouteMessageObserver); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace media_router | 44 } // namespace media_router |
45 | 45 |
46 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ | 46 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_OBSERVER_H_ |
OLD | NEW |