Index: chrome/browser/resources/options/managed_user_import.js |
diff --git a/chrome/browser/resources/options/managed_user_import.js b/chrome/browser/resources/options/managed_user_import.js |
index 0152169cb6be4bc018ee41e72983e626d595bbf6..8ab2b96b78e9ef73f1b8885e78d8b3b5f860cd35 100644 |
--- a/chrome/browser/resources/options/managed_user_import.js |
+++ b/chrome/browser/resources/options/managed_user_import.js |
@@ -50,7 +50,8 @@ cr.define('options', function() { |
return; |
$('managed-user-import-ok').disabled = |
- managedUserList.selectedItem.onCurrentDevice; |
+ managedUserList.selectedItem.onCurrentDevice || |
+ managedUserList.selectedItem.nameConflict; |
}); |
var self = this; |
@@ -75,7 +76,7 @@ cr.define('options', function() { |
* @override |
*/ |
didShowPage: function() { |
- options.ManagedUserListData.requestExistingManagedUsers( |
+ options.ManagedUserListData.requestExistingManagedUsers().then( |
this.receiveExistingManagedUsers_, this.onSigninError_.bind(this)); |
this.updateImportInProgress_(false); |
@@ -167,12 +168,17 @@ cr.define('options', function() { |
* name: "Managed User Name", |
* iconURL: "chrome://path/to/icon/image", |
* onCurrentDevice: true or false, |
+ * nameConflict: true or false, |
* needAvatar: true or false |
* } |
* @private |
*/ |
receiveExistingManagedUsers_: function(managedUsers) { |
managedUsers.sort(function(a, b) { |
+ if (a.onCurrentDevice != b.onCurrentDevice) |
+ return a.onCurrentDevice ? 1 : -1; |
+ if (a.nameConflict != b.nameConflict) |
+ return a.nameConflict ? 1 : -1; |
return a.name.localeCompare(b.name); |
}); |