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

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: fix AlertDialog style 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.
Dan Beam 2013/11/07 00:12:37 @private
xiyuan 2013/11/07 00:25:56 Done. Only changed this one since I want to keep t
592 */
593 showDeviceRequisitionRemoraPrompt_: function() {
594 if (!this.deviceRequisitionRemoraDialog_) {
595 this.deviceRequisitionRemoraDialog_ =
596 new cr.ui.dialogs.AlertDialog(document.body);
597 this.deviceRequisitionRemoraDialog_.setOkLabel(
598 loadTimeData.getString('deviceRequisitionPromptOk'));
599 }
600 this.deviceRequisitionRemoraDialog_.show(
601 loadTimeData.getString('deviceRequisitionRemoraPromptText'),
602 function() {
603 chrome.send('setDeviceRequisition', ['remora']);
604 });
605 },
606
607 /**
593 * Returns true if Oobe UI is shown. 608 * Returns true if Oobe UI is shown.
594 */ 609 */
595 isOobeUI: function() { 610 isOobeUI: function() {
596 return document.body.classList.contains('oobe-display'); 611 return document.body.classList.contains('oobe-display');
597 }, 612 },
598 613
599 /** 614 /**
600 * Returns true if sign in UI should trigger wallpaper load on boot. 615 * Returns true if sign in UI should trigger wallpaper load on boot.
601 */ 616 */
602 shouldLoadWallpaperOnBoot: function() { 617 shouldLoadWallpaperOnBoot: function() {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 */ 823 */
809 DisplayManager.refocusCurrentPod = function() { 824 DisplayManager.refocusCurrentPod = function() {
810 $('pod-row').refocusCurrentPod(); 825 $('pod-row').refocusCurrentPod();
811 }; 826 };
812 827
813 // Export 828 // Export
814 return { 829 return {
815 DisplayManager: DisplayManager 830 DisplayManager: DisplayManager
816 }; 831 };
817 }); 832 });
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