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

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: Address Derek's comments 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 void InitForTest(MediaRouter* router, 157 void InitForTest(MediaRouter* router,
158 content::WebContents* initiator, 158 content::WebContents* initiator,
159 MediaRouterWebUIMessageHandler* handler, 159 MediaRouterWebUIMessageHandler* handler,
160 std::unique_ptr<CreatePresentationConnectionRequest> 160 std::unique_ptr<CreatePresentationConnectionRequest>
161 create_session_request); 161 create_session_request);
162 162
163 private: 163 private:
164 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortedSinks); 164 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortedSinks);
165 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortSinksByIconType); 165 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortSinksByIconType);
166 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 166 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, FilterNonDisplayRoutes);
167 UIMediaRoutesObserverFiltersNonDisplayRoutes); 167 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, FilterNonDisplayJoinableRoutes);
168 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
169 UIMediaRoutesObserverFiltersNonDisplayJoinableRoutes);
170 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 168 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
171 UIMediaRoutesObserverAssignsCurrentCastModes); 169 UIMediaRoutesObserverAssignsCurrentCastModes);
172 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 170 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
173 UIMediaRoutesObserverSkipsUnavailableCastModes); 171 UIMediaRoutesObserverSkipsUnavailableCastModes);
174 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); 172 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent);
175 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 173 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
176 GetExtensionNameEmptyWhenNotInstalled); 174 GetExtensionNameEmptyWhenNotInstalled);
177 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 175 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
178 GetExtensionNameEmptyWhenNotExtensionURL); 176 GetExtensionNameEmptyWhenNotExtensionURL);
179 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 177 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 MediaSource::Id* source_id, 261 MediaSource::Id* source_id,
264 GURL* origin, 262 GURL* origin,
265 std::vector<MediaRouteResponseCallback>* route_response_callbacks, 263 std::vector<MediaRouteResponseCallback>* route_response_callbacks,
266 base::TimeDelta* timeout, 264 base::TimeDelta* timeout,
267 bool* incognito); 265 bool* incognito);
268 266
269 // Updates the set of supported cast modes and sends the updated set to 267 // Updates the set of supported cast modes and sends the updated set to
270 // |handler_|. 268 // |handler_|.
271 void UpdateCastModes(); 269 void UpdateCastModes();
272 270
271 // Updates the routes-to-cast-modes mapping in |current_cast_modes_| to match
272 // the value of |routes_|.
273 void UpdateCurrentCastModes();
274
273 // Returns the default presentation request's frame URL if there is one. 275 // Returns the default presentation request's frame URL if there is one.
274 // Otherwise returns an empty GURL. 276 // Otherwise returns an empty GURL.
275 GURL GetFrameURL() const; 277 GURL GetFrameURL() const;
276 278
277 // Owned by the |web_ui| passed in the ctor, and guaranteed to be deleted 279 // Owned by the |web_ui| passed in the ctor, and guaranteed to be deleted
278 // only after it has deleted |this|. 280 // only after it has deleted |this|.
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.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // NOTE: Weak pointers must be invalidated before all other member variables. 336 // NOTE: Weak pointers must be invalidated before all other member variables.
335 // Therefore |weak_factory_| must be placed at the end. 337 // Therefore |weak_factory_| must be placed at the end.
336 base::WeakPtrFactory<MediaRouterUI> weak_factory_; 338 base::WeakPtrFactory<MediaRouterUI> weak_factory_;
337 339
338 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); 340 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI);
339 }; 341 };
340 342
341 } // namespace media_router 343 } // namespace media_router
342 344
343 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ 345 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698