OLD | NEW |
---|---|
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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
11 * ManageProfileOverlay class | 11 * ManageProfileOverlay class |
12 * Encapsulated handling of the 'Manage profile...' overlay page. | 12 * Encapsulated handling of the 'Manage profile...' overlay page. |
13 * @constructor | 13 * @constructor |
14 * @class | 14 * @extends {cr.ui.pageManager.Page} |
15 */ | 15 */ |
16 function ManageProfileOverlay() { | 16 function ManageProfileOverlay() { |
17 Page.call(this, 'manageProfile', | 17 Page.call(this, 'manageProfile', |
18 loadTimeData.getString('manageProfileTabTitle'), | 18 loadTimeData.getString('manageProfileTabTitle'), |
19 'manage-profile-overlay'); | 19 'manage-profile-overlay'); |
20 }; | 20 }; |
21 | 21 |
22 cr.addSingletonGetter(ManageProfileOverlay); | 22 cr.addSingletonGetter(ManageProfileOverlay); |
23 | 23 |
24 ManageProfileOverlay.prototype = { | 24 ManageProfileOverlay.prototype = { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 // Check if another supervised user also exists with that name. | 380 // Check if another supervised user also exists with that name. |
381 var nameIsUnique = true; | 381 var nameIsUnique = true; |
382 var j; | 382 var j; |
383 for (j = i + 1; j < supervisedUsers.length; ++j) { | 383 for (j = i + 1; j < supervisedUsers.length; ++j) { |
384 if (supervisedUsers[j].name == newName) { | 384 if (supervisedUsers[j].name == newName) { |
385 nameIsUnique = false; | 385 nameIsUnique = false; |
386 break; | 386 break; |
387 } | 387 } |
388 } | 388 } |
389 var self = this; | 389 var self = this; |
390 function getImportHandler(supervisedUser, nameIsUnique) { | 390 var getImportHandler = function(supervisedUser, nameIsUnique) { |
391 return function() { | 391 return function() { |
392 if (supervisedUser.needAvatar || !nameIsUnique) { | 392 if (supervisedUser.needAvatar || !nameIsUnique) { |
393 PageManager.showPageByName('supervisedUserImport'); | 393 PageManager.showPageByName('supervisedUserImport'); |
394 } else { | 394 } else { |
395 self.hideErrorBubble_('create'); | 395 self.hideErrorBubble_('create'); |
396 CreateProfileOverlay.updateCreateInProgress(true); | 396 CreateProfileOverlay.updateCreateInProgress(true); |
397 chrome.send('createProfile', | 397 chrome.send('createProfile', |
398 [supervisedUser.name, supervisedUser.iconURL, false, true, | 398 [supervisedUser.name, supervisedUser.iconURL, false, true, |
399 supervisedUser.id]); | 399 supervisedUser.id]); |
400 } | 400 } |
401 } | 401 } |
402 }; | 402 }; |
Dan Beam
2014/09/06 02:22:36
it'd probably be better just to remove the ; at th
Vitaly Pavlenko
2014/09/06 22:54:08
## /usr/local/google/home/vitalyp/src/chrome/brows
Dan Beam
2014/09/09 02:59:09
probably still better to put at the top of the fun
Vitaly Pavlenko
2014/09/09 17:54:51
Not sure, if I'm doing it right. Please, have a lo
| |
403 $('supervised-user-import-existing').onclick = | 403 $('supervised-user-import-existing').onclick = |
404 getImportHandler(supervisedUsers[i], nameIsUnique); | 404 getImportHandler(supervisedUsers[i], nameIsUnique); |
405 $('create-profile-ok').disabled = true; | 405 $('create-profile-ok').disabled = true; |
406 return; | 406 return; |
407 } | 407 } |
408 } | 408 } |
409 }, | 409 }, |
410 | 410 |
411 /** | 411 /** |
412 * Called in case the request for the list of supervised users fails because | 412 * Called in case the request for the list of supervised users fails because |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
863 return instance[name + '_'].apply(instance, arguments); | 863 return instance[name + '_'].apply(instance, arguments); |
864 }; | 864 }; |
865 }); | 865 }); |
866 | 866 |
867 // Export | 867 // Export |
868 return { | 868 return { |
869 ManageProfileOverlay: ManageProfileOverlay, | 869 ManageProfileOverlay: ManageProfileOverlay, |
870 CreateProfileOverlay: CreateProfileOverlay, | 870 CreateProfileOverlay: CreateProfileOverlay, |
871 }; | 871 }; |
872 }); | 872 }); |
OLD | NEW |