OLD | NEW |
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_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 // associated with a media source. This class allows the dialog to receive | 31 // associated with a media source. This class allows the dialog to receive |
32 // lists of MediaSinks compatible with the cast modes available through the | 32 // lists of MediaSinks compatible with the cast modes available through the |
33 // dialog. | 33 // dialog. |
34 // | 34 // |
35 // Typical use: | 35 // Typical use: |
36 // | 36 // |
37 // QueryResultManager::Observer* observer = ...; | 37 // QueryResultManager::Observer* observer = ...; |
38 // QueryResultManager result_manager(router); | 38 // QueryResultManager result_manager(router); |
39 // result_manager.AddObserver(observer); | 39 // result_manager.AddObserver(observer); |
40 // result_manager.StartSinksQuery(MediaCastMode::DEFAULT, | 40 // result_manager.StartSinksQuery(MediaCastMode::DEFAULT, |
41 // ForPresentationUrl("http://google.com")); | 41 // MediaSourceForPresentationUrl("http://google.com")); |
42 // result_manager.StartSinksQuery(MediaCastMode::TAB_MIRROR, | 42 // result_manager.StartSinksQuery(MediaCastMode::TAB_MIRROR, |
43 // ForTabMediaSource(123)); | 43 // MediaSourceForTab(123)); |
44 // ... | 44 // ... |
45 // [Updates will be received by observer via OnResultsUpdated()] | 45 // [Updates will be received by observer via OnResultsUpdated()] |
46 // ... | 46 // ... |
47 // [When info on MediaSource is needed, i.e. when requesting route for a mode] | 47 // [When info on MediaSource is needed, i.e. when requesting route for a mode] |
48 // CastModeSet cast_modes; | 48 // CastModeSet cast_modes; |
49 // result_manager.GetSupportedCastModes(&cast_modes); | 49 // result_manager.GetSupportedCastModes(&cast_modes); |
50 // [Logic to select a MediaCastMode from the set] | 50 // [Logic to select a MediaCastMode from the set] |
51 // MediaSource source = result_manager.GetSourceForCastMode( | 51 // MediaSource source = result_manager.GetSourceForCastMode( |
52 // MediaCastMode::TAB_MIRROR); | 52 // MediaCastMode::TAB_MIRROR); |
53 // if (!source.Empty()) { | 53 // if (!source.Empty()) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 MediaRouter* router_; | 139 MediaRouter* router_; |
140 | 140 |
141 base::ThreadChecker thread_checker_; | 141 base::ThreadChecker thread_checker_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(QueryResultManager); | 143 DISALLOW_COPY_AND_ASSIGN(QueryResultManager); |
144 }; | 144 }; |
145 | 145 |
146 } // namespace media_router | 146 } // namespace media_router |
147 | 147 |
148 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ | 148 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ |
OLD | NEW |