Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Side by Side Diff: chrome/browser/resources/chromeos/login/display_manager.js

Issue 61523002: cros: Use AlertDialog for remora device requisition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @fileoverview Display manager for WebUI OOBE and login. 6 * @fileoverview Display manager for WebUI OOBE and login.
7 */ 7 */
8 8
9 // TODO(xiyuan): Find a better to share those constants. 9 // TODO(xiyuan): Find a better to share those constants.
10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; 10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect';
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } else if (name == ACCELERATOR_RESET) { 222 } else if (name == ACCELERATOR_RESET) {
223 var currentStepId = this.screens_[this.currentStep_]; 223 var currentStepId = this.screens_[this.currentStep_];
224 if (currentStepId == SCREEN_GAIA_SIGNIN || 224 if (currentStepId == SCREEN_GAIA_SIGNIN ||
225 currentStepId == SCREEN_ACCOUNT_PICKER) { 225 currentStepId == SCREEN_ACCOUNT_PICKER) {
226 chrome.send('toggleResetScreen'); 226 chrome.send('toggleResetScreen');
227 } 227 }
228 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { 228 } else if (name == ACCELERATOR_DEVICE_REQUISITION) {
229 if (this.isOobeUI()) 229 if (this.isOobeUI())
230 this.showDeviceRequisitionPrompt_(); 230 this.showDeviceRequisitionPrompt_();
231 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { 231 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) {
232 if (this.isOobeUI()) { 232 if (this.isOobeUI())
233 this.deviceRequisition_ = 'remora'; 233 this.showDeviceRequisitionRemoraPrompt_();
234 this.showDeviceRequisitionPrompt_();
235 }
236 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { 234 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) {
237 var currentStepId = this.screens_[this.currentStep_]; 235 var currentStepId = this.screens_[this.currentStep_];
238 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) 236 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
239 chrome.send('cancelAppLaunch'); 237 chrome.send('cancelAppLaunch');
240 } 238 }
241 239
242 if (!this.forceKeyboardFlow_) 240 if (!this.forceKeyboardFlow_)
243 return; 241 return;
244 242
245 // Handle special accelerators for keyboard enhanced navigation flow. 243 // Handle special accelerators for keyboard enhanced navigation flow.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 581
584 /* 582 /*
585 * Updates the device requisition string shown in the requisition prompt. 583 * Updates the device requisition string shown in the requisition prompt.
586 * @param {string} requisition The device requisition. 584 * @param {string} requisition The device requisition.
587 */ 585 */
588 updateDeviceRequisition: function(requisition) { 586 updateDeviceRequisition: function(requisition) {
589 this.deviceRequisition_ = requisition; 587 this.deviceRequisition_ = requisition;
590 }, 588 },
591 589
592 /** 590 /**
591 * Shows the special remora device requisition prompt.
592 * @private
593 */
594 showDeviceRequisitionRemoraPrompt_: function() {
595 if (!this.deviceRequisitionRemoraDialog_) {
596 this.deviceRequisitionRemoraDialog_ =
597 new cr.ui.dialogs.AlertDialog(document.body);
598 this.deviceRequisitionRemoraDialog_.setOkLabel(
599 loadTimeData.getString('deviceRequisitionPromptOk'));
600 }
601 this.deviceRequisitionRemoraDialog_.show(
602 loadTimeData.getString('deviceRequisitionRemoraPromptText'),
603 function() {
604 chrome.send('setDeviceRequisition', ['remora']);
605 });
606 },
607
608 /**
593 * Returns true if Oobe UI is shown. 609 * Returns true if Oobe UI is shown.
594 */ 610 */
595 isOobeUI: function() { 611 isOobeUI: function() {
596 return document.body.classList.contains('oobe-display'); 612 return document.body.classList.contains('oobe-display');
597 }, 613 },
598 614
599 /** 615 /**
600 * Returns true if sign in UI should trigger wallpaper load on boot. 616 * Returns true if sign in UI should trigger wallpaper load on boot.
601 */ 617 */
602 shouldLoadWallpaperOnBoot: function() { 618 shouldLoadWallpaperOnBoot: function() {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 */ 824 */
809 DisplayManager.refocusCurrentPod = function() { 825 DisplayManager.refocusCurrentPod = function() {
810 $('pod-row').refocusCurrentPod(); 826 $('pod-row').refocusCurrentPod();
811 }; 827 };
812 828
813 // Export 829 // Export
814 return { 830 return {
815 DisplayManager: DisplayManager 831 DisplayManager: DisplayManager
816 }; 832 };
817 }); 833 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698