| Index: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
|
| diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
|
| index 9fef1a147ed3dc52f8e0e4e4d5052785e3c128f4..45cbe8cf279700a72a420955ee49525b4ca6c9de 100644
|
| --- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
|
| @@ -295,7 +295,7 @@ UserManagerScreenHandler::~UserManagerScreenHandler() {
|
|
|
| void UserManagerScreenHandler::ShowBannerMessage(
|
| const base::string16& message) {
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "login.AccountPickerScreen.showBannerMessage",
|
| base::StringValue(message));
|
| }
|
| @@ -308,14 +308,14 @@ void UserManagerScreenHandler::ShowUserPodCustomIcon(
|
| icon_options.ToDictionaryValue();
|
| if (!icon || icon->empty())
|
| return;
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "login.AccountPickerScreen.showUserPodCustomIcon",
|
| base::StringValue(account_id.GetUserEmail()), *icon);
|
| }
|
|
|
| void UserManagerScreenHandler::HideUserPodCustomIcon(
|
| const AccountId& account_id) {
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "login.AccountPickerScreen.hideUserPodCustomIcon",
|
| base::StringValue(account_id.GetUserEmail()));
|
| }
|
| @@ -333,10 +333,10 @@ void UserManagerScreenHandler::SetAuthType(
|
| return;
|
|
|
| user_auth_type_map_[account_id.GetUserEmail()] = auth_type;
|
| - web_ui()->CallJavascriptFunction("login.AccountPickerScreen.setAuthType",
|
| - base::StringValue(account_id.GetUserEmail()),
|
| - base::FundamentalValue(auth_type),
|
| - base::StringValue(auth_value));
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "login.AccountPickerScreen.setAuthType",
|
| + base::StringValue(account_id.GetUserEmail()),
|
| + base::FundamentalValue(auth_type), base::StringValue(auth_value));
|
| }
|
|
|
| proximity_auth::ScreenlockBridge::LockHandler::AuthType
|
| @@ -372,7 +372,8 @@ void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) {
|
| args->GetString(0, &url_hash_);
|
|
|
| SendUserList();
|
| - web_ui()->CallJavascriptFunction("cr.ui.UserManager.showUserManagerScreen",
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "cr.ui.UserManager.showUserManagerScreen",
|
| base::FundamentalValue(IsGuestModeEnabled()),
|
| base::FundamentalValue(IsAddPersonEnabled()));
|
|
|
| @@ -575,9 +576,9 @@ void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
|
| stats_success &= item.success;
|
| }
|
| if (stats_success) {
|
| - web_ui()->CallJavascriptFunction("updateRemoveWarningDialog",
|
| - base::StringValue(profile_path.value()),
|
| - return_value);
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "updateRemoveWarningDialog", base::StringValue(profile_path.value()),
|
| + return_value);
|
| return;
|
| }
|
| }
|
| @@ -599,9 +600,9 @@ void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback(
|
| stat->SetBooleanWithoutPathExpansion("success", item.success);
|
| return_value.SetWithoutPathExpansion(item.category, std::move(stat));
|
| }
|
| - web_ui()->CallJavascriptFunction("updateRemoveWarningDialog",
|
| - base::StringValue(profile_path.value()),
|
| - return_value);
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "updateRemoveWarningDialog", base::StringValue(profile_path.value()),
|
| + return_value);
|
| }
|
|
|
| void UserManagerScreenHandler::HandleGetRemoveWarningDialogMessage(
|
| @@ -632,10 +633,9 @@ void UserManagerScreenHandler::HandleGetRemoveWarningDialogMessage(
|
| base::StringValue message = base::StringValue(
|
| l10n_util::GetPluralStringFUTF16(message_id, total_count));
|
|
|
| - web_ui()->CallJavascriptFunction("updateRemoveWarningDialogSetMessage",
|
| - base::StringValue(profile_path),
|
| - message,
|
| - base::FundamentalValue(total_count));
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "updateRemoveWarningDialogSetMessage", base::StringValue(profile_path),
|
| + message, base::FundamentalValue(total_count));
|
| }
|
|
|
| void UserManagerScreenHandler::OnGetTokenInfoResponse(
|
| @@ -891,8 +891,9 @@ void UserManagerScreenHandler::SendUserList() {
|
| users_list.Append(profile_value);
|
| }
|
|
|
| - web_ui()->CallJavascriptFunction("login.AccountPickerScreen.loadUsers",
|
| - users_list, base::FundamentalValue(IsGuestModeEnabled()));
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "login.AccountPickerScreen.loadUsers", users_list,
|
| + base::FundamentalValue(IsGuestModeEnabled()));
|
|
|
| // This is the latest C++ code we have in the flow to show the UserManager.
|
| // This may be invoked more than once per UserManager lifetime; the
|
| @@ -913,15 +914,13 @@ void UserManagerScreenHandler::ReportAuthenticationResult(
|
| weak_ptr_factory_.GetWeakPtr()),
|
| ProfileMetrics::SWITCH_PROFILE_UNLOCK);
|
| } else {
|
| - web_ui()->CallJavascriptFunction(
|
| - "cr.ui.UserManager.showSignInError",
|
| - base::FundamentalValue(0),
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "cr.ui.UserManager.showSignInError", base::FundamentalValue(0),
|
| base::StringValue(l10n_util::GetStringUTF8(
|
| - auth == ProfileMetrics::AUTH_FAILED_OFFLINE ?
|
| - IDS_LOGIN_ERROR_AUTHENTICATING_OFFLINE :
|
| - IDS_LOGIN_ERROR_AUTHENTICATING)),
|
| - base::StringValue(""),
|
| - base::FundamentalValue(0));
|
| + auth == ProfileMetrics::AUTH_FAILED_OFFLINE
|
| + ? IDS_LOGIN_ERROR_AUTHENTICATING_OFFLINE
|
| + : IDS_LOGIN_ERROR_AUTHENTICATING)),
|
| + base::StringValue(""), base::FundamentalValue(0));
|
| }
|
| }
|
|
|
|
|