| OLD | NEW |
| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
| 14 #include "base/metrics/user_metrics.h" | 14 #include "base/metrics/user_metrics.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/media/router/media_router_metrics.h" | 18 #include "chrome/browser/media/router/media_router_metrics.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/signin/signin_manager_factory.h" | 20 #include "chrome/browser/signin/signin_manager_factory.h" |
| 21 #include "chrome/browser/sync/profile_sync_service_factory.h" | 21 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 22 #include "chrome/browser/ui/webui/media_router/media_cast_mode.h" | 22 #include "chrome/browser/ui/webui/media_router/media_cast_mode.h" |
| 23 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" | 23 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
| 24 #include "chrome/common/chrome_features.h" | 24 #include "chrome/common/media_router/issue.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
| 27 #include "components/browser_sync/profile_sync_service.h" | 27 #include "components/browser_sync/profile_sync_service.h" |
| 28 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
| 29 #include "components/signin/core/browser/signin_manager.h" | 29 #include "components/signin/core/browser/signin_manager.h" |
| 30 #include "content/public/browser/web_ui.h" | 30 #include "content/public/browser/web_ui.h" |
| 31 #include "extensions/common/constants.h" | 31 #include "extensions/common/constants.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 | 33 |
| 34 namespace media_router { | 34 namespace media_router { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 55 const char kReportInitialState[] = "reportInitialState"; | 55 const char kReportInitialState[] = "reportInitialState"; |
| 56 const char kReportNavigateToView[] = "reportNavigateToView"; | 56 const char kReportNavigateToView[] = "reportNavigateToView"; |
| 57 const char kReportRouteCreationOutcome[] = "reportRouteCreationOutcome"; | 57 const char kReportRouteCreationOutcome[] = "reportRouteCreationOutcome"; |
| 58 const char kReportRouteCreation[] = "reportRouteCreation"; | 58 const char kReportRouteCreation[] = "reportRouteCreation"; |
| 59 const char kReportSelectedCastMode[] = "reportSelectedCastMode"; | 59 const char kReportSelectedCastMode[] = "reportSelectedCastMode"; |
| 60 const char kReportSinkCount[] = "reportSinkCount"; | 60 const char kReportSinkCount[] = "reportSinkCount"; |
| 61 const char kReportTimeToClickSink[] = "reportTimeToClickSink"; | 61 const char kReportTimeToClickSink[] = "reportTimeToClickSink"; |
| 62 const char kReportTimeToInitialActionClose[] = "reportTimeToInitialActionClose"; | 62 const char kReportTimeToInitialActionClose[] = "reportTimeToInitialActionClose"; |
| 63 const char kSearchSinksAndCreateRoute[] = "searchSinksAndCreateRoute"; | 63 const char kSearchSinksAndCreateRoute[] = "searchSinksAndCreateRoute"; |
| 64 const char kOnInitialDataReceived[] = "onInitialDataReceived"; | 64 const char kOnInitialDataReceived[] = "onInitialDataReceived"; |
| 65 const char kOnMediaControllerAvailable[] = "onMediaControllerAvailable"; | |
| 66 const char kOnMediaControllerClosed[] = "onMediaControllerClosed"; | |
| 67 const char kPauseCurrentMedia[] = "pauseCurrentMedia"; | |
| 68 const char kPlayCurrentMedia[] = "playCurrentMedia"; | |
| 69 const char kSeekCurrentMedia[] = "seekCurrentMedia"; | |
| 70 const char kSetCurrentMediaMute[] = "setCurrentMediaMute"; | |
| 71 const char kSetCurrentMediaVolume[] = "setCurrentMediaVolume"; | |
| 72 | 65 |
| 73 // JS function names. | 66 // JS function names. |
| 74 const char kSetInitialData[] = "media_router.ui.setInitialData"; | 67 const char kSetInitialData[] = "media_router.ui.setInitialData"; |
| 75 const char kOnCreateRouteResponseReceived[] = | 68 const char kOnCreateRouteResponseReceived[] = |
| 76 "media_router.ui.onCreateRouteResponseReceived"; | 69 "media_router.ui.onCreateRouteResponseReceived"; |
| 77 const char kOnRouteControllerInvalidated[] = | |
| 78 "media_router.ui.onRouteControllerInvalidated"; | |
| 79 const char kReceiveSearchResult[] = "media_router.ui.receiveSearchResult"; | 70 const char kReceiveSearchResult[] = "media_router.ui.receiveSearchResult"; |
| 80 const char kSetFirstRunFlowData[] = "media_router.ui.setFirstRunFlowData"; | 71 const char kSetFirstRunFlowData[] = "media_router.ui.setFirstRunFlowData"; |
| 81 const char kSetIssue[] = "media_router.ui.setIssue"; | 72 const char kSetIssue[] = "media_router.ui.setIssue"; |
| 82 const char kSetSinkListAndIdentity[] = "media_router.ui.setSinkListAndIdentity"; | 73 const char kSetSinkListAndIdentity[] = "media_router.ui.setSinkListAndIdentity"; |
| 83 const char kSetRouteList[] = "media_router.ui.setRouteList"; | 74 const char kSetRouteList[] = "media_router.ui.setRouteList"; |
| 84 const char kSetCastModeList[] = "media_router.ui.setCastModeList"; | 75 const char kSetCastModeList[] = "media_router.ui.setCastModeList"; |
| 85 const char kUpdateMaxHeight[] = "media_router.ui.updateMaxHeight"; | 76 const char kUpdateMaxHeight[] = "media_router.ui.updateMaxHeight"; |
| 86 const char kUpdateRouteStatus[] = "media_router.ui.updateRouteStatus"; | |
| 87 const char kWindowOpen[] = "window.open"; | 77 const char kWindowOpen[] = "window.open"; |
| 88 | 78 |
| 89 std::unique_ptr<base::DictionaryValue> SinksAndIdentityToValue( | 79 std::unique_ptr<base::DictionaryValue> SinksAndIdentityToValue( |
| 90 const std::vector<MediaSinkWithCastModes>& sinks, | 80 const std::vector<MediaSinkWithCastModes>& sinks, |
| 91 const AccountInfo& account_info) { | 81 const AccountInfo& account_info) { |
| 92 std::unique_ptr<base::DictionaryValue> sink_list_and_identity( | 82 std::unique_ptr<base::DictionaryValue> sink_list_and_identity( |
| 93 new base::DictionaryValue); | 83 new base::DictionaryValue); |
| 94 bool show_email = false; | 84 bool show_email = false; |
| 95 bool show_domain = false; | 85 bool show_domain = false; |
| 96 std::string user_domain; | 86 std::string user_domain; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 void MediaRouterWebUIMessageHandler::ClearIssue() { | 307 void MediaRouterWebUIMessageHandler::ClearIssue() { |
| 318 DVLOG(2) << "ClearIssue"; | 308 DVLOG(2) << "ClearIssue"; |
| 319 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue, base::Value()); | 309 web_ui()->CallJavascriptFunctionUnsafe(kSetIssue, base::Value()); |
| 320 } | 310 } |
| 321 | 311 |
| 322 void MediaRouterWebUIMessageHandler::UpdateMaxDialogHeight(int height) { | 312 void MediaRouterWebUIMessageHandler::UpdateMaxDialogHeight(int height) { |
| 323 DVLOG(2) << "UpdateMaxDialogHeight"; | 313 DVLOG(2) << "UpdateMaxDialogHeight"; |
| 324 web_ui()->CallJavascriptFunctionUnsafe(kUpdateMaxHeight, base::Value(height)); | 314 web_ui()->CallJavascriptFunctionUnsafe(kUpdateMaxHeight, base::Value(height)); |
| 325 } | 315 } |
| 326 | 316 |
| 327 void MediaRouterWebUIMessageHandler::UpdateMediaRouteStatus( | |
| 328 const MediaStatus& status) { | |
| 329 current_media_status_ = base::make_optional<MediaStatus>(MediaStatus(status)); | |
| 330 | |
| 331 base::DictionaryValue status_value; | |
| 332 status_value.SetString("title", status.title); | |
| 333 status_value.SetString("description", status.description); | |
| 334 status_value.SetBoolean("canPlayPause", status.can_play_pause); | |
| 335 status_value.SetBoolean("canMute", status.can_mute); | |
| 336 status_value.SetBoolean("canSetVolume", status.can_set_volume); | |
| 337 status_value.SetBoolean("canSeek", status.can_seek); | |
| 338 status_value.SetBoolean("isPaused", status.is_paused); | |
| 339 status_value.SetBoolean("isMuted", status.is_muted); | |
| 340 status_value.SetInteger("duration", status.duration.InSeconds()); | |
| 341 status_value.SetInteger("currentTime", status.current_time.InSeconds()); | |
| 342 status_value.SetDouble("volume", status.volume); | |
| 343 web_ui()->CallJavascriptFunctionUnsafe(kUpdateRouteStatus, | |
| 344 std::move(status_value)); | |
| 345 } | |
| 346 | |
| 347 void MediaRouterWebUIMessageHandler::OnRouteControllerInvalidated() { | |
| 348 web_ui()->CallJavascriptFunctionUnsafe(kOnRouteControllerInvalidated); | |
| 349 } | |
| 350 | |
| 351 void MediaRouterWebUIMessageHandler::RegisterMessages() { | 317 void MediaRouterWebUIMessageHandler::RegisterMessages() { |
| 352 web_ui()->RegisterMessageCallback( | 318 web_ui()->RegisterMessageCallback( |
| 353 kRequestInitialData, | 319 kRequestInitialData, |
| 354 base::Bind(&MediaRouterWebUIMessageHandler::OnRequestInitialData, | 320 base::Bind(&MediaRouterWebUIMessageHandler::OnRequestInitialData, |
| 355 base::Unretained(this))); | 321 base::Unretained(this))); |
| 356 web_ui()->RegisterMessageCallback( | 322 web_ui()->RegisterMessageCallback( |
| 357 kCreateRoute, | 323 kCreateRoute, |
| 358 base::Bind(&MediaRouterWebUIMessageHandler::OnCreateRoute, | 324 base::Bind(&MediaRouterWebUIMessageHandler::OnCreateRoute, |
| 359 base::Unretained(this))); | 325 base::Unretained(this))); |
| 360 web_ui()->RegisterMessageCallback( | 326 web_ui()->RegisterMessageCallback( |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 &MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose, | 393 &MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose, |
| 428 base::Unretained(this))); | 394 base::Unretained(this))); |
| 429 web_ui()->RegisterMessageCallback( | 395 web_ui()->RegisterMessageCallback( |
| 430 kSearchSinksAndCreateRoute, | 396 kSearchSinksAndCreateRoute, |
| 431 base::Bind(&MediaRouterWebUIMessageHandler::OnSearchSinksAndCreateRoute, | 397 base::Bind(&MediaRouterWebUIMessageHandler::OnSearchSinksAndCreateRoute, |
| 432 base::Unretained(this))); | 398 base::Unretained(this))); |
| 433 web_ui()->RegisterMessageCallback( | 399 web_ui()->RegisterMessageCallback( |
| 434 kOnInitialDataReceived, | 400 kOnInitialDataReceived, |
| 435 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived, | 401 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived, |
| 436 base::Unretained(this))); | 402 base::Unretained(this))); |
| 437 web_ui()->RegisterMessageCallback( | |
| 438 kOnMediaControllerAvailable, | |
| 439 base::Bind(&MediaRouterWebUIMessageHandler::OnMediaControllerAvailable, | |
| 440 base::Unretained(this))); | |
| 441 web_ui()->RegisterMessageCallback( | |
| 442 kOnMediaControllerClosed, | |
| 443 base::Bind(&MediaRouterWebUIMessageHandler::OnMediaControllerClosed, | |
| 444 base::Unretained(this))); | |
| 445 web_ui()->RegisterMessageCallback( | |
| 446 kPauseCurrentMedia, | |
| 447 base::Bind(&MediaRouterWebUIMessageHandler::OnPauseCurrentMedia, | |
| 448 base::Unretained(this))); | |
| 449 web_ui()->RegisterMessageCallback( | |
| 450 kPlayCurrentMedia, | |
| 451 base::Bind(&MediaRouterWebUIMessageHandler::OnPlayCurrentMedia, | |
| 452 base::Unretained(this))); | |
| 453 web_ui()->RegisterMessageCallback( | |
| 454 kSeekCurrentMedia, | |
| 455 base::Bind(&MediaRouterWebUIMessageHandler::OnSeekCurrentMedia, | |
| 456 base::Unretained(this))); | |
| 457 web_ui()->RegisterMessageCallback( | |
| 458 kSetCurrentMediaMute, | |
| 459 base::Bind(&MediaRouterWebUIMessageHandler::OnSetCurrentMediaMute, | |
| 460 base::Unretained(this))); | |
| 461 web_ui()->RegisterMessageCallback( | |
| 462 kSetCurrentMediaVolume, | |
| 463 base::Bind(&MediaRouterWebUIMessageHandler::OnSetCurrentMediaVolume, | |
| 464 base::Unretained(this))); | |
| 465 } | 403 } |
| 466 | 404 |
| 467 void MediaRouterWebUIMessageHandler::OnRequestInitialData( | 405 void MediaRouterWebUIMessageHandler::OnRequestInitialData( |
| 468 const base::ListValue* args) { | 406 const base::ListValue* args) { |
| 469 DVLOG(1) << "OnRequestInitialData"; | 407 DVLOG(1) << "OnRequestInitialData"; |
| 470 media_router_ui_->OnUIInitiallyLoaded(); | 408 media_router_ui_->OnUIInitiallyLoaded(); |
| 471 base::DictionaryValue initial_data; | 409 base::DictionaryValue initial_data; |
| 472 | 410 |
| 473 // "No Cast devices found?" Chromecast help center page. | 411 // "No Cast devices found?" Chromecast help center page. |
| 474 initial_data.SetString("deviceMissingUrl", | 412 initial_data.SetString("deviceMissingUrl", |
| (...skipping 14 matching lines...) Expand all Loading... |
| 489 initial_data.Set("castModes", std::move(cast_modes_list)); | 427 initial_data.Set("castModes", std::move(cast_modes_list)); |
| 490 | 428 |
| 491 // If the cast mode last chosen for the current origin is tab mirroring, | 429 // If the cast mode last chosen for the current origin is tab mirroring, |
| 492 // that should be the cast mode initially selected in the dialog. Otherwise | 430 // that should be the cast mode initially selected in the dialog. Otherwise |
| 493 // the initial cast mode should be chosen automatically by the dialog. | 431 // the initial cast mode should be chosen automatically by the dialog. |
| 494 bool use_tab_mirroring = | 432 bool use_tab_mirroring = |
| 495 base::ContainsKey(cast_modes, MediaCastMode::TAB_MIRROR) && | 433 base::ContainsKey(cast_modes, MediaCastMode::TAB_MIRROR) && |
| 496 media_router_ui_->UserSelectedTabMirroringForCurrentOrigin(); | 434 media_router_ui_->UserSelectedTabMirroringForCurrentOrigin(); |
| 497 initial_data.SetBoolean("useTabMirroring", use_tab_mirroring); | 435 initial_data.SetBoolean("useTabMirroring", use_tab_mirroring); |
| 498 | 436 |
| 499 initial_data.SetBoolean( | |
| 500 "useNewRouteControls", | |
| 501 base::FeatureList::IsEnabled(features::kMediaRouterUIRouteController)); | |
| 502 | |
| 503 web_ui()->CallJavascriptFunctionUnsafe(kSetInitialData, initial_data); | 437 web_ui()->CallJavascriptFunctionUnsafe(kSetInitialData, initial_data); |
| 504 media_router_ui_->UIInitialized(); | 438 media_router_ui_->UIInitialized(); |
| 505 } | 439 } |
| 506 | 440 |
| 507 void MediaRouterWebUIMessageHandler::OnCreateRoute( | 441 void MediaRouterWebUIMessageHandler::OnCreateRoute( |
| 508 const base::ListValue* args) { | 442 const base::ListValue* args) { |
| 509 DVLOG(1) << "OnCreateRoute"; | 443 DVLOG(1) << "OnCreateRoute"; |
| 510 const base::DictionaryValue* args_dict = nullptr; | 444 const base::DictionaryValue* args_dict = nullptr; |
| 511 std::string sink_id; | 445 std::string sink_id; |
| 512 int cast_mode_num = -1; | 446 int cast_mode_num = -1; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 static_cast<MediaCastMode>(cast_mode_num)); | 782 static_cast<MediaCastMode>(cast_mode_num)); |
| 849 } | 783 } |
| 850 | 784 |
| 851 void MediaRouterWebUIMessageHandler::OnInitialDataReceived( | 785 void MediaRouterWebUIMessageHandler::OnInitialDataReceived( |
| 852 const base::ListValue* args) { | 786 const base::ListValue* args) { |
| 853 DVLOG(1) << "OnInitialDataReceived"; | 787 DVLOG(1) << "OnInitialDataReceived"; |
| 854 media_router_ui_->OnUIInitialDataReceived(); | 788 media_router_ui_->OnUIInitialDataReceived(); |
| 855 MaybeUpdateFirstRunFlowData(); | 789 MaybeUpdateFirstRunFlowData(); |
| 856 } | 790 } |
| 857 | 791 |
| 858 void MediaRouterWebUIMessageHandler::OnMediaControllerAvailable( | |
| 859 const base::ListValue* args) { | |
| 860 const base::DictionaryValue* args_dict = nullptr; | |
| 861 std::string route_id; | |
| 862 if (!args->GetDictionary(0, &args_dict) || | |
| 863 !args_dict->GetString("routeId", &route_id)) { | |
| 864 DVLOG(1) << "Unable to extract media route ID"; | |
| 865 return; | |
| 866 } | |
| 867 media_router_ui_->OnMediaControllerUIAvailable(route_id); | |
| 868 } | |
| 869 | |
| 870 void MediaRouterWebUIMessageHandler::OnMediaControllerClosed( | |
| 871 const base::ListValue* args) { | |
| 872 current_media_status_.reset(); | |
| 873 media_router_ui_->OnMediaControllerUIClosed(); | |
| 874 } | |
| 875 | |
| 876 void MediaRouterWebUIMessageHandler::OnPauseCurrentMedia( | |
| 877 const base::ListValue* args) { | |
| 878 const MediaRouteController* route_controller = | |
| 879 media_router_ui_->GetMediaRouteController(); | |
| 880 if (route_controller) | |
| 881 route_controller->Pause(); | |
| 882 } | |
| 883 | |
| 884 void MediaRouterWebUIMessageHandler::OnPlayCurrentMedia( | |
| 885 const base::ListValue* args) { | |
| 886 const MediaRouteController* route_controller = | |
| 887 media_router_ui_->GetMediaRouteController(); | |
| 888 if (route_controller) | |
| 889 route_controller->Play(); | |
| 890 } | |
| 891 | |
| 892 void MediaRouterWebUIMessageHandler::OnSeekCurrentMedia( | |
| 893 const base::ListValue* args) { | |
| 894 const base::DictionaryValue* args_dict = nullptr; | |
| 895 int time; | |
| 896 if (!args->GetDictionary(0, &args_dict) || | |
| 897 !args_dict->GetInteger("time", &time)) { | |
| 898 DVLOG(1) << "Unable to extract time"; | |
| 899 return; | |
| 900 } | |
| 901 base::TimeDelta time_delta = base::TimeDelta::FromSeconds(time); | |
| 902 const MediaRouteController* route_controller = | |
| 903 media_router_ui_->GetMediaRouteController(); | |
| 904 if (route_controller && current_media_status_ && | |
| 905 time_delta >= base::TimeDelta() && | |
| 906 time_delta <= current_media_status_->duration) { | |
| 907 route_controller->Seek(time_delta); | |
| 908 } | |
| 909 } | |
| 910 | |
| 911 void MediaRouterWebUIMessageHandler::OnSetCurrentMediaMute( | |
| 912 const base::ListValue* args) { | |
| 913 const base::DictionaryValue* args_dict = nullptr; | |
| 914 bool mute; | |
| 915 if (!args->GetDictionary(0, &args_dict) || | |
| 916 !args_dict->GetBoolean("mute", &mute)) { | |
| 917 DVLOG(1) << "Unable to extract mute"; | |
| 918 return; | |
| 919 } | |
| 920 const MediaRouteController* route_controller = | |
| 921 media_router_ui_->GetMediaRouteController(); | |
| 922 if (route_controller) | |
| 923 route_controller->SetMute(mute); | |
| 924 } | |
| 925 | |
| 926 void MediaRouterWebUIMessageHandler::OnSetCurrentMediaVolume( | |
| 927 const base::ListValue* args) { | |
| 928 const base::DictionaryValue* args_dict = nullptr; | |
| 929 double volume; | |
| 930 if (!args->GetDictionary(0, &args_dict) || | |
| 931 !args_dict->GetDouble("volume", &volume)) { | |
| 932 DVLOG(1) << "Unable to extract volume"; | |
| 933 return; | |
| 934 } | |
| 935 const MediaRouteController* route_controller = | |
| 936 media_router_ui_->GetMediaRouteController(); | |
| 937 if (route_controller && volume >= 0 && volume <= 1) | |
| 938 route_controller->SetVolume(volume); | |
| 939 } | |
| 940 | |
| 941 bool MediaRouterWebUIMessageHandler::ActOnIssueType( | 792 bool MediaRouterWebUIMessageHandler::ActOnIssueType( |
| 942 IssueInfo::Action action_type, | 793 IssueInfo::Action action_type, |
| 943 const base::DictionaryValue* args) { | 794 const base::DictionaryValue* args) { |
| 944 if (action_type == IssueInfo::Action::LEARN_MORE) { | 795 if (action_type == IssueInfo::Action::LEARN_MORE) { |
| 945 std::string learn_more_url = GetLearnMoreUrl(args); | 796 std::string learn_more_url = GetLearnMoreUrl(args); |
| 946 if (learn_more_url.empty()) | 797 if (learn_more_url.empty()) |
| 947 return false; | 798 return false; |
| 948 std::unique_ptr<base::ListValue> open_args(new base::ListValue); | 799 std::unique_ptr<base::ListValue> open_args(new base::ListValue); |
| 949 open_args->AppendString(learn_more_url); | 800 open_args->AppendString(learn_more_url); |
| 950 web_ui()->CallJavascriptFunctionUnsafe(kWindowOpen, *open_args); | 801 web_ui()->CallJavascriptFunctionUnsafe(kWindowOpen, *open_args); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 } | 894 } |
| 1044 | 895 |
| 1045 return value; | 896 return value; |
| 1046 } | 897 } |
| 1047 | 898 |
| 1048 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { | 899 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { |
| 1049 set_web_ui(web_ui); | 900 set_web_ui(web_ui); |
| 1050 } | 901 } |
| 1051 | 902 |
| 1052 } // namespace media_router | 903 } // namespace media_router |
| OLD | NEW |