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

Unified Diff: chrome/browser/resources/options/manage_profile_overlay.js

Issue 15774008: Pass errors generated during limited-user registration up to the UI for display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressed Drew's comments Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/manage_profile_overlay.js
===================================================================
--- chrome/browser/resources/options/manage_profile_overlay.js (revision 203598)
+++ chrome/browser/resources/options/manage_profile_overlay.js (working copy)
@@ -51,8 +51,8 @@
// Override the create-profile-ok handler, to avoid closing the overlay
// until we finish creating the profile.
$('create-profile-ok').onclick = function(event) {
+ CreateProfileOverlay.updateCreateInProgress(true);
ManageProfileOverlay.getInstance().hideErrorBubble_('create');
- $('create-profile-ok').disabled = true;
self.submitCreateProfile_();
};
@@ -433,6 +433,7 @@
$('create-profile-instructions').textContent =
loadTimeData.getStringF('createProfileInstructions');
this.hideErrorBubble_();
+ this.updateCreateInProgress_(false);
var shortcutsEnabled = loadTimeData.getBoolean('profileShortcutsEnabled');
$('create-shortcut-container').hidden = !shortcutsEnabled;
@@ -456,17 +457,39 @@
},
/**
+ * Updates the UI when a profile create step begins or ends.
+ * @param {boolean} inProgress True if the UI should be updated to show that
+ * profile creation is now in progress.
+ * @private
+ */
+ updateCreateInProgress_: function(inProgress) {
+ $('create-profile-ok').disabled = inProgress;
+ $('create-profile-throbber').hidden = !inProgress;
+ },
+
+ /**
* Shows an error message describing a local error (most likely a disk
* error) when creating a new profile. Called by BrowserOptions via the
* BrowserOptionsHandler.
* @private
*/
onLocalError_: function() {
- $('create-profile-ok').disabled = false;
+ this.updateCreateInProgress_(false);
this.showErrorBubble_('createProfileLocalError');
},
/**
+ * Shows an error message describing a remote error (most likely a network
+ * error) when creating a new profile. Called by BrowserOptions via the
+ * BrowserOptionsHandler.
+ * @private
+ */
+ onRemoteError_: function() {
+ this.updateCreateInProgress_(false);
+ this.showErrorBubble_('createProfileRemoteError');
+ },
+
+ /**
* For new limited users, shows a confirmation page after successfully
* creating a new profile; otherwise, the handler will open a new window.
* @param {Object} profileInfo An object of the form:
@@ -478,8 +501,8 @@
* @private
*/
onSuccess_: function(profileInfo) {
+ this.updateCreateInProgress_(false);
OptionsPage.closeOverlay();
- $('create-profile-ok').disabled = false;
if (profileInfo.isManaged) {
ManagedUserCreateConfirmOverlay.setProfileInfo(profileInfo);
OptionsPage.navigateToPage('managedUserCreateConfirm');
@@ -506,7 +529,9 @@
// Forward public APIs to private implementations.
[
'onLocalError',
+ 'onRemoteError',
'onSuccess',
+ 'updateCreateInProgress',
'updateSignedInStatus',
].forEach(function(name) {
CreateProfileOverlay[name] = function() {
« no previous file with comments | « chrome/browser/resources/options/manage_profile_overlay.html ('k') | chrome/browser/ui/app_list/profile_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698