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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_ui.h

Issue 2540773005: Add GetCurrentRoutes() to MediaRouter API, ensure dialog has routes at init (Closed)
Patch Set: Created 4 years 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_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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; } 140 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; }
141 const std::unordered_map<MediaRoute::Id, MediaCastMode>& current_cast_modes() 141 const std::unordered_map<MediaRoute::Id, MediaCastMode>& current_cast_modes()
142 const { 142 const {
143 return current_cast_modes_; 143 return current_cast_modes_;
144 } 144 }
145 const content::WebContents* initiator() const { return initiator_; } 145 const content::WebContents* initiator() const { return initiator_; }
146 146
147 // Marked virtual for tests. 147 // Marked virtual for tests.
148 virtual const std::string& GetRouteProviderExtensionId() const; 148 virtual const std::string& GetRouteProviderExtensionId() const;
149 149
150 const std::vector<MediaRoute>& GetRoutes();
151
150 // Called to track UI metrics. 152 // Called to track UI metrics.
151 void SetUIInitializationTimer(const base::Time& start_time); 153 void SetUIInitializationTimer(const base::Time& start_time);
152 void OnUIInitiallyLoaded(); 154 void OnUIInitiallyLoaded();
153 void OnUIInitialDataReceived(); 155 void OnUIInitialDataReceived();
154 156
155 void UpdateMaxDialogHeight(int height); 157 void UpdateMaxDialogHeight(int height);
156 158
157 void InitForTest(MediaRouter* router, 159 void InitForTest(MediaRouter* router,
158 content::WebContents* initiator, 160 content::WebContents* initiator,
159 MediaRouterWebUIMessageHandler* handler, 161 MediaRouterWebUIMessageHandler* handler,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 MediaRouterWebUIMessageHandler* handler_; 281 MediaRouterWebUIMessageHandler* handler_;
280 282
281 // These are non-null while this instance is registered to receive 283 // These are non-null while this instance is registered to receive
282 // updates from them. 284 // updates from them.
283 std::unique_ptr<IssuesObserver> issues_observer_; 285 std::unique_ptr<IssuesObserver> issues_observer_;
284 std::unique_ptr<MediaRoutesObserver> routes_observer_; 286 std::unique_ptr<MediaRoutesObserver> routes_observer_;
285 287
286 // Set to true by |handler_| when the UI has been initialized. 288 // Set to true by |handler_| when the UI has been initialized.
287 bool ui_initialized_; 289 bool ui_initialized_;
288 290
291 bool initial_routes_received_;
292
289 // Set to -1 if not tracking a pending route request. 293 // Set to -1 if not tracking a pending route request.
290 int current_route_request_id_; 294 int current_route_request_id_;
291 295
292 // Sequential counter for route requests. Used to update 296 // Sequential counter for route requests. Used to update
293 // |current_route_request_id_| when there is a new route request. 297 // |current_route_request_id_| when there is a new route request.
294 int route_request_counter_; 298 int route_request_counter_;
295 299
296 // Used for locale-aware sorting of sinks by name. Set during |InitCommon()| 300 // Used for locale-aware sorting of sinks by name. Set during |InitCommon()|
297 // using the current locale. Set to null 301 // using the current locale. Set to null
298 std::unique_ptr<icu::Collator> collator_; 302 std::unique_ptr<icu::Collator> collator_;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // NOTE: Weak pointers must be invalidated before all other member variables. 338 // NOTE: Weak pointers must be invalidated before all other member variables.
335 // Therefore |weak_factory_| must be placed at the end. 339 // Therefore |weak_factory_| must be placed at the end.
336 base::WeakPtrFactory<MediaRouterUI> weak_factory_; 340 base::WeakPtrFactory<MediaRouterUI> weak_factory_;
337 341
338 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); 342 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI);
339 }; 343 };
340 344
341 } // namespace media_router 345 } // namespace media_router
342 346
343 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ 347 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698