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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const MediaRoute* route) { 277 const MediaRoute* route) {
278 DVLOG(2) << "OnCreateRouteResponseReceived"; 278 DVLOG(2) << "OnCreateRouteResponseReceived";
279 if (route) { 279 if (route) {
280 int current_cast_mode = CurrentCastModeForRouteId( 280 int current_cast_mode = CurrentCastModeForRouteId(
281 route->media_route_id(), media_router_ui_->routes_and_cast_modes()); 281 route->media_route_id(), media_router_ui_->routes_and_cast_modes());
282 std::unique_ptr<base::DictionaryValue> route_value(RouteToValue( 282 std::unique_ptr<base::DictionaryValue> route_value(RouteToValue(
283 *route, false, media_router_ui_->GetRouteProviderExtensionId(), 283 *route, false, media_router_ui_->GetRouteProviderExtensionId(),
284 incognito_, current_cast_mode)); 284 incognito_, current_cast_mode));
285 web_ui()->CallJavascriptFunctionUnsafe( 285 web_ui()->CallJavascriptFunctionUnsafe(
286 kOnCreateRouteResponseReceived, base::StringValue(sink_id), 286 kOnCreateRouteResponseReceived, base::StringValue(sink_id),
287 *route_value, base::FundamentalValue(route->for_display())); 287 *route_value, base::Value(route->for_display()));
288 } else { 288 } else {
289 web_ui()->CallJavascriptFunctionUnsafe( 289 web_ui()->CallJavascriptFunctionUnsafe(
290 kOnCreateRouteResponseReceived, base::StringValue(sink_id), 290 kOnCreateRouteResponseReceived, base::StringValue(sink_id),
291 *base::Value::CreateNullValue(), base::FundamentalValue(false)); 291 *base::Value::CreateNullValue(), base::Value(false));
292 } 292 }
293 } 293 }
294 294
295 void MediaRouterWebUIMessageHandler::ReturnSearchResult( 295 void MediaRouterWebUIMessageHandler::ReturnSearchResult(
296 const std::string& sink_id) { 296 const std::string& sink_id) {
297 DVLOG(2) << "ReturnSearchResult"; 297 DVLOG(2) << "ReturnSearchResult";
298 web_ui()->CallJavascriptFunctionUnsafe(kReceiveSearchResult, 298 web_ui()->CallJavascriptFunctionUnsafe(kReceiveSearchResult,
299 base::StringValue(sink_id)); 299 base::StringValue(sink_id));
300 } 300 }
301 301
302 void MediaRouterWebUIMessageHandler::UpdateIssue(const Issue& issue) { 302 void MediaRouterWebUIMessageHandler::UpdateIssue(const Issue& issue) {
303 DVLOG(2) << "UpdateIssue"; 303 DVLOG(2) << "UpdateIssue";
304 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue, *IssueToValue(issue)); 304 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue, *IssueToValue(issue));
305 } 305 }
306 306
307 void MediaRouterWebUIMessageHandler::ClearIssue() { 307 void MediaRouterWebUIMessageHandler::ClearIssue() {
308 DVLOG(2) << "ClearIssue"; 308 DVLOG(2) << "ClearIssue";
309 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue, 309 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue,
310 *base::Value::CreateNullValue()); 310 *base::Value::CreateNullValue());
311 } 311 }
312 312
313 void MediaRouterWebUIMessageHandler::UpdateMaxDialogHeight(int height) { 313 void MediaRouterWebUIMessageHandler::UpdateMaxDialogHeight(int height) {
314 DVLOG(2) << "UpdateMaxDialogHeight"; 314 DVLOG(2) << "UpdateMaxDialogHeight";
315 web_ui()->CallJavascriptFunctionUnsafe(kUpdateMaxHeight, 315 web_ui()->CallJavascriptFunctionUnsafe(kUpdateMaxHeight, base::Value(height));
316 base::FundamentalValue(height));
317 } 316 }
318 317
319 void MediaRouterWebUIMessageHandler::RegisterMessages() { 318 void MediaRouterWebUIMessageHandler::RegisterMessages() {
320 web_ui()->RegisterMessageCallback( 319 web_ui()->RegisterMessageCallback(
321 kRequestInitialData, 320 kRequestInitialData,
322 base::Bind(&MediaRouterWebUIMessageHandler::OnRequestInitialData, 321 base::Bind(&MediaRouterWebUIMessageHandler::OnRequestInitialData,
323 base::Unretained(this))); 322 base::Unretained(this)));
324 web_ui()->RegisterMessageCallback( 323 web_ui()->RegisterMessageCallback(
325 kCreateRoute, 324 kCreateRoute,
326 base::Bind(&MediaRouterWebUIMessageHandler::OnCreateRoute, 325 base::Bind(&MediaRouterWebUIMessageHandler::OnCreateRoute,
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 } 895 }
897 896
898 return value; 897 return value;
899 } 898 }
900 899
901 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { 900 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) {
902 set_web_ui(web_ui); 901 set_web_ui(web_ui);
903 } 902 }
904 903
905 } // namespace media_router 904 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698