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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_ui.cc

Issue 1273423004: Shows a launch spinner next to a sink once it is selected to create a route. The launch spinner sur… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/media_router/media_router_ui.cc
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.cc b/chrome/browser/ui/webui/media_router/media_router_ui.cc
index 706b63deaa311f7c236c7ee874632040eb5a45c5..c7e76f7efa2e6bfc351214f553dad61d4460ef2c 100644
--- a/chrome/browser/ui/webui/media_router/media_router_ui.cc
+++ b/chrome/browser/ui/webui/media_router/media_router_ui.cc
@@ -285,16 +285,16 @@ void MediaRouterUI::OnRoutesUpdated(const std::vector<MediaRoute>& routes) {
handler_->UpdateRoutes(routes_);
}
-void MediaRouterUI::OnRouteResponseReceived(const MediaRoute* route,
+void MediaRouterUI::OnRouteResponseReceived(const MediaSink::Id& sink_id,
+ const MediaRoute* route,
const std::string& presentation_id,
const std::string& error) {
DVLOG(1) << "OnRouteResponseReceived";
// TODO(imcheng): Display error in UI. (crbug.com/490372)
if (!route)
- LOG(ERROR) << "MediaRouteResponse returned error: " << error;
- else
- handler_->AddRoute(*route);
+ DVLOG(0) << "MediaRouteResponse returned error: " << error;
+ handler_->OnCreateRouteResponseReceived(sink_id, route);
has_pending_route_request_ = false;
requesting_route_for_default_source_ = false;
}
@@ -342,8 +342,9 @@ bool MediaRouterUI::DoCreateRoute(const MediaSink::Id& sink_id,
// treat subsequent route requests from a Presentation API-initiated dialogs
// as browser-initiated.
std::vector<MediaRouteResponseCallback> route_response_callbacks;
- route_response_callbacks.push_back(base::Bind(
- &MediaRouterUI::OnRouteResponseReceived, weak_factory_.GetWeakPtr()));
+ route_response_callbacks.push_back(
+ base::Bind(&MediaRouterUI::OnRouteResponseReceived,
+ weak_factory_.GetWeakPtr(), sink_id));
if (requesting_route_for_default_source_) {
if (presentation_request_) {
// |presentation_request_| will be nullptr after this call, as the

Powered by Google App Engine
This is Rietveld 408576698