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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 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 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 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 std::unique_ptr<base::ListValue> MediaRouterWebUIMessageHandler::RoutesToValue( 873 std::unique_ptr<base::ListValue> MediaRouterWebUIMessageHandler::RoutesToValue(
874 const std::vector<MediaRoute>& routes, 874 const std::vector<MediaRoute>& routes,
875 const std::vector<MediaRoute::Id>& joinable_route_ids, 875 const std::vector<MediaRoute::Id>& joinable_route_ids,
876 const std::unordered_map<MediaRoute::Id, MediaCastMode>& current_cast_modes) 876 const std::unordered_map<MediaRoute::Id, MediaCastMode>& current_cast_modes)
877 const { 877 const {
878 std::unique_ptr<base::ListValue> value(new base::ListValue); 878 std::unique_ptr<base::ListValue> value(new base::ListValue);
879 const std::string& extension_id = 879 const std::string& extension_id =
880 media_router_ui_->GetRouteProviderExtensionId(); 880 media_router_ui_->GetRouteProviderExtensionId();
881 881
882 for (const MediaRoute& route : routes) { 882 for (const MediaRoute& route : routes) {
883 bool can_join = ContainsValue(joinable_route_ids, route.media_route_id()); 883 bool can_join =
884 base::ContainsValue(joinable_route_ids, route.media_route_id());
884 int current_cast_mode = CurrentCastModeForRouteId(route.media_route_id(), 885 int current_cast_mode = CurrentCastModeForRouteId(route.media_route_id(),
885 current_cast_modes); 886 current_cast_modes);
886 std::unique_ptr<base::DictionaryValue> route_val(RouteToValue( 887 std::unique_ptr<base::DictionaryValue> route_val(RouteToValue(
887 route, can_join, extension_id, incognito_, current_cast_mode)); 888 route, can_join, extension_id, incognito_, current_cast_mode));
888 value->Append(std::move(route_val)); 889 value->Append(std::move(route_val));
889 } 890 }
890 891
891 return value; 892 return value;
892 } 893 }
893 894
894 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { 895 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) {
895 set_web_ui(web_ui); 896 set_web_ui(web_ui);
896 } 897 }
897 898
898 } // namespace media_router 899 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_ui.cc ('k') | chrome/browser/ui/webui/media_router/query_result_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698