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

Side by Side Diff: chrome/browser/media/router/media_router.h

Issue 1383653002: MediaRouterAction: Only observe Media Routes when there is a local route. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_MEDIA_ROUTER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "chrome/browser/media/router/issue.h" 13 #include "chrome/browser/media/router/issue.h"
14 #include "chrome/browser/media/router/media_route.h" 14 #include "chrome/browser/media/router/media_route.h"
15 #include "chrome/browser/media/router/media_sink.h" 15 #include "chrome/browser/media/router/media_sink.h"
16 #include "chrome/browser/media/router/media_source.h" 16 #include "chrome/browser/media/router/media_source.h"
17 #include "components/keyed_service/core/keyed_service.h" 17 #include "components/keyed_service/core/keyed_service.h"
18 #include "content/public/browser/presentation_session_message.h" 18 #include "content/public/browser/presentation_session_message.h"
19 19
20 namespace media_router { 20 namespace media_router {
21 21
22 class IssuesObserver; 22 class IssuesObserver;
23 class LocalMediaRoutesObserver;
23 class MediaRoutesObserver; 24 class MediaRoutesObserver;
24 class MediaSinksObserver; 25 class MediaSinksObserver;
25 class PresentationSessionMessagesObserver; 26 class PresentationSessionMessagesObserver;
26 27
27 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is 28 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is
28 // invoked when the route request either succeeded or failed. 29 // invoked when the route request either succeeded or failed.
29 // On success: 30 // On success:
30 // |route|: The route created or joined. 31 // |route|: The route created or joined.
31 // |presentation_id|: 32 // |presentation_id|:
32 // The presentation ID of the route created or joined. In the case of 33 // The presentation ID of the route created or joined. In the case of
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Clears the issue with the id |issue_id|. 111 // Clears the issue with the id |issue_id|.
111 virtual void ClearIssue(const Issue::Id& issue_id) = 0; 112 virtual void ClearIssue(const Issue::Id& issue_id) = 0;
112 113
113 // Indicates that a presentation session has detached from the underlying 114 // Indicates that a presentation session has detached from the underlying
114 // MediaRoute |route_id| (due to navigation, garbage collection, etc.) 115 // MediaRoute |route_id| (due to navigation, garbage collection, etc.)
115 virtual void OnPresentationSessionDetached( 116 virtual void OnPresentationSessionDetached(
116 const MediaRoute::Id& route_id) = 0; 117 const MediaRoute::Id& route_id) = 0;
117 118
118 private: 119 private:
119 friend class IssuesObserver; 120 friend class IssuesObserver;
121 friend class LocalMediaRoutesObserver;
120 friend class MediaSinksObserver; 122 friend class MediaSinksObserver;
121 friend class MediaRoutesObserver; 123 friend class MediaRoutesObserver;
122 friend class PresentationSessionMessagesObserver; 124 friend class PresentationSessionMessagesObserver;
123 125
124 // The following functions are called by friend Observer classes above. 126 // The following functions are called by friend Observer classes above.
125 127
126 // Registers |observer| with this MediaRouter. |observer| specifies a media 128 // Registers |observer| with this MediaRouter. |observer| specifies a media
127 // source and will receive updates with media sinks that are compatible with 129 // source and will receive updates with media sinks that are compatible with
128 // that source. The initial update may happen synchronously. 130 // that source. The initial update may happen synchronously.
129 // NOTE: This class does not assume ownership of |observer|. Callers must 131 // NOTE: This class does not assume ownership of |observer|. Callers must
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // |observer|. |observer| should be unregistered before it is destroyed. 167 // |observer|. |observer| should be unregistered before it is destroyed.
166 // Registering the same observer more than once will result in undefined 168 // Registering the same observer more than once will result in undefined
167 // behavior. 169 // behavior.
168 virtual void RegisterPresentationSessionMessagesObserver( 170 virtual void RegisterPresentationSessionMessagesObserver(
169 PresentationSessionMessagesObserver* observer) = 0; 171 PresentationSessionMessagesObserver* observer) = 0;
170 172
171 // Unregisters a previously registered PresentationSessionMessagesObserver. 173 // Unregisters a previously registered PresentationSessionMessagesObserver.
172 // |observer| will stop receiving further updates. 174 // |observer| will stop receiving further updates.
173 virtual void UnregisterPresentationSessionMessagesObserver( 175 virtual void UnregisterPresentationSessionMessagesObserver(
174 PresentationSessionMessagesObserver* observer) = 0; 176 PresentationSessionMessagesObserver* observer) = 0;
177
178 // Adds the LocalMediaRoutesObserver |observer| to listen for newly created
179 // MediaRoutes.
180 virtual void RegisterLocalMediaRoutesObserver(
181 LocalMediaRoutesObserver* observer) = 0;
182
183 // Removes the LocalMediaRoutesObserver |observer|.
184 virtual void UnregisterLocalMediaRoutesObserver(
185 LocalMediaRoutesObserver* observer) = 0;
175 }; 186 };
176 187
177 } // namespace media_router 188 } // namespace media_router
178 189
179 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 190 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698