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 <memory> |
9 #include <set> | 10 #include <set> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "chrome/browser/media/router/media_routes_observer.h" | 17 #include "chrome/browser/media/router/media_routes_observer.h" |
18 #include "chrome/browser/media/router/media_sink.h" | 18 #include "chrome/browser/media/router/media_sink.h" |
19 #include "chrome/browser/media/router/media_source.h" | 19 #include "chrome/browser/media/router/media_source.h" |
20 #include "chrome/browser/ui/webui/media_router/media_cast_mode.h" | 20 #include "chrome/browser/ui/webui/media_router/media_cast_mode.h" |
21 #include "chrome/browser/ui/webui/media_router/media_sink_with_cast_modes.h" | 21 #include "chrome/browser/ui/webui/media_router/media_sink_with_cast_modes.h" |
22 | 22 |
23 namespace media_router { | 23 namespace media_router { |
24 | 24 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // |cast_mode|. | 121 // |cast_mode|. |
122 void UpdateWithSinksQueryResult(MediaCastMode cast_mode, | 122 void UpdateWithSinksQueryResult(MediaCastMode cast_mode, |
123 const std::vector<MediaSink>& result); | 123 const std::vector<MediaSink>& result); |
124 | 124 |
125 // Notifies observers that results have been updated. | 125 // Notifies observers that results have been updated. |
126 void NotifyOnResultsUpdated(); | 126 void NotifyOnResultsUpdated(); |
127 | 127 |
128 // MediaSinksObservers that listens for compatible MediaSink updates. | 128 // MediaSinksObservers that listens for compatible MediaSink updates. |
129 // Each observer is associated with a MediaCastMode. Results received by | 129 // Each observer is associated with a MediaCastMode. Results received by |
130 // observers are propagated back to this class. | 130 // observers are propagated back to this class. |
131 std::map<MediaCastMode, scoped_ptr<MediaSinksObserver>> sinks_observers_; | 131 std::map<MediaCastMode, std::unique_ptr<MediaSinksObserver>> sinks_observers_; |
132 | 132 |
133 // Holds registrations of MediaSources for cast modes. | 133 // Holds registrations of MediaSources for cast modes. |
134 std::map<MediaCastMode, MediaSource> cast_mode_sources_; | 134 std::map<MediaCastMode, MediaSource> cast_mode_sources_; |
135 | 135 |
136 // Holds all known sinks and their associated cast modes. | 136 // Holds all known sinks and their associated cast modes. |
137 std::map<MediaSink::Id, MediaSinkWithCastModes> all_sinks_; | 137 std::map<MediaSink::Id, MediaSinkWithCastModes> all_sinks_; |
138 | 138 |
139 // Registered observers. | 139 // Registered observers. |
140 base::ObserverList<Observer> observers_; | 140 base::ObserverList<Observer> observers_; |
141 | 141 |
142 // Not owned by this object. | 142 // Not owned by this object. |
143 MediaRouter* router_; | 143 MediaRouter* router_; |
144 | 144 |
145 base::ThreadChecker thread_checker_; | 145 base::ThreadChecker thread_checker_; |
146 | 146 |
147 DISALLOW_COPY_AND_ASSIGN(QueryResultManager); | 147 DISALLOW_COPY_AND_ASSIGN(QueryResultManager); |
148 }; | 148 }; |
149 | 149 |
150 } // namespace media_router | 150 } // namespace media_router |
151 | 151 |
152 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ | 152 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_QUERY_RESULT_MANAGER_H_ |
OLD | NEW |