Commit 6cd16e29 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

cros: Fix a JS error and wrong kiosk log

- Fix a JS error when user presses accelerator too quickly;
- Fix a wrongly emitted kiosk launch log introduced during refactoring;

Bug: 823768
Change-Id: I432f7e1a6fc7fd62794c81aafc75ea8efcc75fd2
Reviewed-on: https://chromium-review.googlesource.com/973465Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544736}
parent fd12b477
...@@ -109,14 +109,13 @@ class KioskProfileLoader::CryptohomedChecker ...@@ -109,14 +109,13 @@ class KioskProfileLoader::CryptohomedChecker
return; return;
} }
if (!is_mounted.value())
SYSLOG(ERROR) << "Cryptohome is mounted before launching kiosk app.";
// Proceed only when cryptohome is not mounded or running on dev box. // Proceed only when cryptohome is not mounded or running on dev box.
if (!is_mounted.value() || !base::SysInfo::IsRunningOnChromeOS()) if (!is_mounted.value() || !base::SysInfo::IsRunningOnChromeOS()) {
ReportCheckResult(KioskAppLaunchError::NONE); ReportCheckResult(KioskAppLaunchError::NONE);
else } else {
SYSLOG(ERROR) << "Cryptohome is mounted before launching kiosk app.";
ReportCheckResult(KioskAppLaunchError::ALREADY_MOUNTED); ReportCheckResult(KioskAppLaunchError::ALREADY_MOUNTED);
}
} }
void ReportCheckResult(KioskAppLaunchError::Error error) { void ReportCheckResult(KioskAppLaunchError::Error error) {
......
...@@ -385,12 +385,12 @@ cr.define('cr.ui.login', function() { ...@@ -385,12 +385,12 @@ cr.define('cr.ui.login', function() {
* @param {string} name Accelerator name. * @param {string} name Accelerator name.
*/ */
handleAccelerator: function(name) { handleAccelerator: function(name) {
if (this.currentScreen.ignoreAccelerators) { if (this.currentScreen && this.currentScreen.ignoreAccelerators) {
return; return;
} }
var currentStepId = this.screens_[this.currentStep_]; var currentStepId = this.screens_[this.currentStep_];
if (name == ACCELERATOR_CANCEL) { if (name == ACCELERATOR_CANCEL) {
if (this.currentScreen.cancel) { if (this.currentScreen && this.currentScreen.cancel) {
this.currentScreen.cancel(); this.currentScreen.cancel();
} }
} else if (name == ACCELERATOR_ENABLE_DEBBUGING) { } else if (name == ACCELERATOR_ENABLE_DEBBUGING) {
......
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