Commit ccedda4a authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Migrate more usages of CallJSWithPrefix to CallJS

Bug: 908498
Change-Id: I2d70ad8c05955c2271fe99e7941dcd451f72928f
Reviewed-on: https://chromium-review.googlesource.com/c/1351558
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625300}
parent 7d3c4de1
......@@ -59,8 +59,8 @@ void AppDownloadingScreenHandler::Bind(AppDownloadingScreen* screen) {
void AppDownloadingScreenHandler::Show() {
ShowScreen(kScreenId);
CallJSWithPrefix("updateNumberOfSelectedApps",
base::Value(GetNumberOfUserSelectedApps()));
CallJS("login.AppDownloadingScreen.updateNumberOfSelectedApps",
base::Value(GetNumberOfUserSelectedApps()));
}
void AppDownloadingScreenHandler::Hide() {}
......
......@@ -114,7 +114,7 @@ void AppLaunchSplashScreenHandler::Hide() {
}
void AppLaunchSplashScreenHandler::ToggleNetworkConfig(bool visible) {
CallJSWithPrefix("toggleNetworkConfig", visible);
CallJS("login.AppLaunchSplashScreen.toggleNetworkConfig", visible);
}
void AppLaunchSplashScreenHandler::UpdateAppLaunchState(AppLaunchState state) {
......@@ -228,7 +228,7 @@ void AppLaunchSplashScreenHandler::PopulateAppInfo(
}
void AppLaunchSplashScreenHandler::SetLaunchText(const std::string& text) {
CallJSWithPrefix("updateMessage", text);
CallJS("login.AppLaunchSplashScreen.updateMessage", text);
}
int AppLaunchSplashScreenHandler::GetProgressMessageFromState(
......
......@@ -94,7 +94,7 @@ void ArcKioskSplashScreenHandler::PopulateAppInfo(
}
void ArcKioskSplashScreenHandler::SetLaunchText(const std::string& text) {
CallJSWithPrefix("updateArcKioskMessage", text);
CallJS("login.ArcKioskSplashScreen.updateArcKioskMessage", text);
}
int ArcKioskSplashScreenHandler::GetProgressMessageFromState(
......
......@@ -87,7 +87,7 @@ void ArcTermsOfServiceScreenHandler::MaybeLoadPlayStoreToS(
if (!ignore_network_state && !default_network)
return;
const std::string country_code = base::CountryCodeForCurrentTimezone();
CallJSWithPrefix("loadPlayStoreToS", country_code);
CallJS("login.ArcTermsOfServiceScreen.loadPlayStoreToS", country_code);
}
void ArcTermsOfServiceScreenHandler::OnCurrentScreenChanged(
......@@ -192,20 +192,22 @@ void ArcTermsOfServiceScreenHandler::OnMetricsModeChanged(bool enabled,
: IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_DISABLED;
}
}
CallJSWithPrefix("setMetricsMode", l10n_util::GetStringUTF16(message_id),
true);
CallJS("login.ArcTermsOfServiceScreen.setMetricsMode",
l10n_util::GetStringUTF16(message_id), true);
}
void ArcTermsOfServiceScreenHandler::OnBackupAndRestoreModeChanged(
bool enabled, bool managed) {
backup_restore_managed_ = managed;
CallJSWithPrefix("setBackupAndRestoreMode", enabled, managed);
CallJS("login.ArcTermsOfServiceScreen.setBackupAndRestoreMode", enabled,
managed);
}
void ArcTermsOfServiceScreenHandler::OnLocationServicesModeChanged(
bool enabled, bool managed) {
location_services_managed_ = managed;
CallJSWithPrefix("setLocationServicesMode", enabled, managed);
CallJS("login.ArcTermsOfServiceScreen.setLocationServicesMode", enabled,
managed);
}
void ArcTermsOfServiceScreenHandler::AddObserver(
......@@ -269,7 +271,7 @@ void ArcTermsOfServiceScreenHandler::DoShow() {
Profile* profile = ProfileManager::GetActiveUserProfile();
CHECK(profile);
CallJSWithPrefix("clearDemoMode");
CallJS("login.ArcTermsOfServiceScreen.clearDemoMode");
// Enable ARC to match ArcSessionManager logic. ArcSessionManager expects that
// ARC is enabled (prefs::kArcEnabled = true) on showing Terms of Service. If
......@@ -280,7 +282,7 @@ void ArcTermsOfServiceScreenHandler::DoShow() {
// Hide the Skip button if the ToS screen can not be skipped during OOBE.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableArcOobeOptinNoSkip)) {
CallJSWithPrefix("hideSkipButton");
CallJS("login.ArcTermsOfServiceScreen.hideSkipButton");
}
action_taken_ = false;
......@@ -288,7 +290,7 @@ void ArcTermsOfServiceScreenHandler::DoShow() {
ShowScreen(kScreenId);
arc_managed_ = arc::IsArcPlayStoreEnabledPreferenceManagedForProfile(profile);
CallJSWithPrefix("setArcManaged", arc_managed_);
CallJS("login.ArcTermsOfServiceScreen.setArcManaged", arc_managed_);
MaybeLoadPlayStoreToS(true);
StartNetworkAndTimeZoneObserving();
......@@ -301,7 +303,7 @@ void ArcTermsOfServiceScreenHandler::DoShow() {
void ArcTermsOfServiceScreenHandler::DoShowForDemoModeSetup() {
DCHECK(arc::IsArcDemoModeSetupFlow());
CallJSWithPrefix("setupForDemoMode");
CallJS("login.ArcTermsOfServiceScreen.setupForDemoMode");
action_taken_ = false;
ShowScreen(kScreenId);
MaybeLoadPlayStoreToS(true);
......
......@@ -161,16 +161,19 @@ void AssistantOptInFlowScreenHandler::Initialize() {
}
void AssistantOptInFlowScreenHandler::OnListeningHotword() {
CallJSWithPrefix("onVoiceMatchUpdate", base::Value("listen"));
CallJS("login.AssistantOptInFlowScreen.onVoiceMatchUpdate",
base::Value("listen"));
}
void AssistantOptInFlowScreenHandler::OnProcessingHotword() {
CallJSWithPrefix("onVoiceMatchUpdate", base::Value("process"));
CallJS("login.AssistantOptInFlowScreen.onVoiceMatchUpdate",
base::Value("process"));
}
void AssistantOptInFlowScreenHandler::OnSpeakerIdEnrollmentDone() {
settings_manager_->StopSpeakerIdEnrollment(base::DoNothing());
CallJSWithPrefix("onVoiceMatchUpdate", base::Value("done"));
CallJS("login.AssistantOptInFlowScreen.onVoiceMatchUpdate",
base::Value("done"));
}
void AssistantOptInFlowScreenHandler::OnSpeakerIdEnrollmentFailure() {
......@@ -192,7 +195,7 @@ void AssistantOptInFlowScreenHandler::SetupAssistantConnection() {
}
void AssistantOptInFlowScreenHandler::ShowNextScreen() {
CallJSWithPrefix("showNextScreen");
CallJS("login.AssistantOptInFlowScreen.showNextScreen");
}
void AssistantOptInFlowScreenHandler::OnActivityControlOptInResult(
......@@ -271,12 +274,12 @@ void AssistantOptInFlowScreenHandler::SendGetSettingsRequest() {
}
void AssistantOptInFlowScreenHandler::ReloadContent(const base::Value& dict) {
CallJSWithPrefix("reloadContent", dict);
CallJS("login.AssistantOptInFlowScreen.reloadContent", dict);
}
void AssistantOptInFlowScreenHandler::AddSettingZippy(const std::string& type,
const base::Value& data) {
CallJSWithPrefix("addSettingZippy", type, data);
CallJS("login.AssistantOptInFlowScreen.addSettingZippy", type, data);
}
void AssistantOptInFlowScreenHandler::OnGetSettingsResponse(
......@@ -490,7 +493,7 @@ void AssistantOptInFlowScreenHandler::HandleFlowFinished() {
if (screen_)
screen_->OnUserAction(kFlowFinished);
else
CallJSWithPrefix("closeDialog");
CallJS("login.AssistantOptInFlowScreen.closeDialog");
}
void AssistantOptInFlowScreenHandler::HandleFlowInitialized(
......
......@@ -44,17 +44,16 @@ void DemoSetupScreenHandler::Bind(DemoSetupScreen* screen) {
void DemoSetupScreenHandler::OnSetupFailed(
const DemoSetupController::DemoSetupError& error) {
// TODO(wzang): Consider customization for RecoveryMethod::kReboot as well.
CallJSWithPrefix(
"onSetupFailed",
base::JoinString({error.GetLocalizedErrorMessage(),
error.GetLocalizedRecoveryMessage()},
base::UTF8ToUTF16(" ")),
error.recovery_method() ==
DemoSetupController::DemoSetupError::RecoveryMethod::kPowerwash);
CallJS("login.DemoSetupScreen.onSetupFailed",
base::JoinString({error.GetLocalizedErrorMessage(),
error.GetLocalizedRecoveryMessage()},
base::UTF8ToUTF16(" ")),
error.recovery_method() ==
DemoSetupController::DemoSetupError::RecoveryMethod::kPowerwash);
}
void DemoSetupScreenHandler::OnSetupSucceeded() {
CallJSWithPrefix("onSetupSucceeded");
CallJS("login.DemoSetupScreen.onSetupSucceeded");
}
void DemoSetupScreenHandler::Initialize() {}
......
......@@ -34,10 +34,9 @@ void DeviceDisabledScreenHandler::Show() {
}
if (delegate_) {
CallJSWithPrefix("setSerialNumberAndEnrollmentDomain",
delegate_->GetSerialNumber(),
delegate_->GetEnrollmentDomain());
CallJSWithPrefix("setMessage", delegate_->GetMessage());
CallJS("login.DeviceDisabledScreen.setSerialNumberAndEnrollmentDomain",
delegate_->GetSerialNumber(), delegate_->GetEnrollmentDomain());
CallJS("login.DeviceDisabledScreen.setMessage", delegate_->GetMessage());
}
ShowScreen(kScreenId);
}
......@@ -54,7 +53,7 @@ void DeviceDisabledScreenHandler::SetDelegate(Delegate* delegate) {
void DeviceDisabledScreenHandler::UpdateMessage(const std::string& message) {
if (page_is_ready())
CallJSWithPrefix("setMessage", message);
CallJS("login.DeviceDisabledScreen.setMessage", message);
}
void DeviceDisabledScreenHandler::DeclareLocalizedValues(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment