| 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_MEDIA_ROUTER_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 174 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
| 175 UIMediaRoutesObserverSkipsUnavailableCastModes); | 175 UIMediaRoutesObserverSkipsUnavailableCastModes); |
| 176 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); | 176 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); |
| 177 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 177 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
| 178 GetExtensionNameEmptyWhenNotInstalled); | 178 GetExtensionNameEmptyWhenNotInstalled); |
| 179 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 179 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
| 180 GetExtensionNameEmptyWhenNotExtensionURL); | 180 GetExtensionNameEmptyWhenNotExtensionURL); |
| 181 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 181 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
| 182 RouteCreationTimeoutForPresentation); | 182 RouteCreationTimeoutForPresentation); |
| 183 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, RouteRequestFromIncognito); | 183 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, RouteRequestFromIncognito); |
| 184 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, UpdateRoutesOnUIInitialized); |
| 184 | 185 |
| 185 class UIIssuesObserver; | 186 class UIIssuesObserver; |
| 186 | 187 |
| 187 class UIMediaRoutesObserver : public MediaRoutesObserver { | 188 class UIMediaRoutesObserver : public MediaRoutesObserver { |
| 188 public: | 189 public: |
| 189 using RoutesUpdatedCallback = | 190 using RoutesUpdatedCallback = |
| 190 base::Callback<void(const std::vector<MediaRoute>&, | 191 base::Callback<void(const std::vector<MediaRoute>&, |
| 191 const std::vector<MediaRoute::Id>&)>; | 192 const std::vector<MediaRoute::Id>&)>; |
| 192 UIMediaRoutesObserver(MediaRouter* router, | 193 UIMediaRoutesObserver(MediaRouter* router, |
| 193 const MediaSource::Id& source_id, | 194 const MediaSource::Id& source_id, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 MediaRouterWebUIMessageHandler* handler_; | 282 MediaRouterWebUIMessageHandler* handler_; |
| 282 | 283 |
| 283 // These are non-null while this instance is registered to receive | 284 // These are non-null while this instance is registered to receive |
| 284 // updates from them. | 285 // updates from them. |
| 285 std::unique_ptr<IssuesObserver> issues_observer_; | 286 std::unique_ptr<IssuesObserver> issues_observer_; |
| 286 std::unique_ptr<MediaRoutesObserver> routes_observer_; | 287 std::unique_ptr<MediaRoutesObserver> routes_observer_; |
| 287 | 288 |
| 288 // Set to true by |handler_| when the UI has been initialized. | 289 // Set to true by |handler_| when the UI has been initialized. |
| 289 bool ui_initialized_; | 290 bool ui_initialized_; |
| 290 | 291 |
| 292 // Set to true when OnRoutesUpdated() is called for the first time. |
| 293 bool initial_routes_received_; |
| 294 |
| 291 // Set to -1 if not tracking a pending route request. | 295 // Set to -1 if not tracking a pending route request. |
| 292 int current_route_request_id_; | 296 int current_route_request_id_; |
| 293 | 297 |
| 294 // Sequential counter for route requests. Used to update | 298 // Sequential counter for route requests. Used to update |
| 295 // |current_route_request_id_| when there is a new route request. | 299 // |current_route_request_id_| when there is a new route request. |
| 296 int route_request_counter_; | 300 int route_request_counter_; |
| 297 | 301 |
| 298 // Used for locale-aware sorting of sinks by name. Set during |InitCommon()| | 302 // Used for locale-aware sorting of sinks by name. Set during |InitCommon()| |
| 299 // using the current locale. Set to null | 303 // using the current locale. Set to null |
| 300 std::unique_ptr<icu::Collator> collator_; | 304 std::unique_ptr<icu::Collator> collator_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // NOTE: Weak pointers must be invalidated before all other member variables. | 340 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 337 // Therefore |weak_factory_| must be placed at the end. | 341 // Therefore |weak_factory_| must be placed at the end. |
| 338 base::WeakPtrFactory<MediaRouterUI> weak_factory_; | 342 base::WeakPtrFactory<MediaRouterUI> weak_factory_; |
| 339 | 343 |
| 340 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); | 344 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); |
| 341 }; | 345 }; |
| 342 | 346 |
| 343 } // namespace media_router | 347 } // namespace media_router |
| 344 | 348 |
| 345 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 349 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| OLD | NEW |