return {
EXTERNAL_API: [
'loadUsers',
+ 'runAppForTesting',
+ 'setApps',
+ 'showAppError',
'updateUserImage',
'forceOnlineSignin',
'setCapsLockState',
/* Cancel user adding if ESC was pressed.
*/
cancel: function() {
- if (Oobe.getInstance().displayType() == DISPLAY_TYPE.USER_ADDING)
+ if (Oobe.getInstance().displayType == DISPLAY_TYPE.USER_ADDING)
chrome.send('cancelUserAdding');
},
var podRow = $('pod-row');
podRow.handleBeforeShow();
- // If this is showing for the lock screen display the sign out button,
- // hide the add user button and activate the locked user's pod.
- var lockedPod = podRow.lockedPod;
- $('add-user-header-bar-item').hidden = !!lockedPod;
- var signOutUserItem = $('sign-out-user-item');
- if (signOutUserItem)
- signOutUserItem.hidden = !lockedPod;
// In case of the preselected pod onShow will be called once pod
// receives focus.
if (!podRow.preselectedPod)
},
/**
+ * Runs app with a given id from the list of loaded apps.
+ * @param {!string} app_id of an app to run.
+ * @param {boolean=} opt_diagnostic_mode Whether to run the app in
+ * diagnostic mode. Default is false.
+ */
+ runAppForTesting: function(app_id, opt_diagnostic_mode) {
+ $('pod-row').findAndRunAppForTesting(app_id, opt_diagnostic_mode);
+ },
+
+ /**
+ * Adds given apps to the pod row.
+ * @param {array} apps Array of apps.
+ */
+ setApps: function(apps) {
+ $('pod-row').setApps(apps);
+ },
+
+ /**
+ * Shows the given kiosk app error message.
+ * @param {!string} message Error message to show.
+ */
+ showAppError: function(message) {
+ // TODO(nkostylev): Figure out a way to show kiosk app launch error
+ // pointing to the kiosk app pod.
+ /** @const */ var BUBBLE_PADDING = 12;
+ $('bubble').showTextForElement($('pod-row'),
+ message,
+ cr.ui.Bubble.Attachment.BOTTOM,
+ $('pod-row').offsetWidth / 2,
+ BUBBLE_PADDING);
+ },
+
+ /**
* Updates current image of a user.
* @param {string} username User for which to update the image.
*/