| 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 /** |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 $('manage-profile-overlay-delete').hidden = false; | 563 $('manage-profile-overlay-delete').hidden = false; |
| 564 $('manage-profile-overlay-disconnect-managed').hidden = true; | 564 $('manage-profile-overlay-disconnect-managed').hidden = true; |
| 565 $('delete-profile-icon').style.content = | 565 $('delete-profile-icon').style.content = |
| 566 getProfileAvatarIcon(profileInfo.iconURL); | 566 getProfileAvatarIcon(profileInfo.iconURL); |
| 567 $('delete-profile-text').textContent = | 567 $('delete-profile-text').textContent = |
| 568 loadTimeData.getStringF('deleteProfileMessage', | 568 loadTimeData.getStringF('deleteProfileMessage', |
| 569 elide(profileInfo.name, /* maxLength */ 50)); | 569 elide(profileInfo.name, /* maxLength */ 50)); |
| 570 $('delete-supervised-profile-addendum').hidden = | 570 $('delete-supervised-profile-addendum').hidden = |
| 571 !profileInfo.isSupervised || profileInfo.isChild; | 571 !profileInfo.isSupervised || profileInfo.isChild; |
| 572 | 572 |
| 573 if (profileInfo.isCurrentProfile) { |
| 574 chrome.send('deleteUserDialogLoadStats', [profileInfo.filePath]); |
| 575 } |
| 576 |
| 573 // Because this dialog isn't useful when refreshing or as part of the | 577 // Because this dialog isn't useful when refreshing or as part of the |
| 574 // history, don't create a history entry for it when showing. | 578 // history, don't create a history entry for it when showing. |
| 575 PageManager.showPageByName('manageProfile', false); | 579 PageManager.showPageByName('manageProfile', false); |
| 576 chrome.send('logDeleteUserDialogShown'); | 580 chrome.send('logDeleteUserDialogShown'); |
| 577 }, | 581 }, |
| 578 | 582 |
| 579 /** | 583 /** |
| 584 * Update the information in the "Delete Profile" dialog. |
| 585 * @param {string} profileURL the filepath of the URL (must be verified) |
| 586 * @param {Object} profileStats Statistics associated with profileURL. |
| 587 * @private |
| 588 */ |
| 589 updateDeleteDialog_: function(profileURL, profileStats) { |
| 590 console.log(JSON.stringify(profileStats)); |
| 591 }, |
| 592 |
| 593 /** |
| 580 * Display the "Disconnect Managed Profile" dialog. | 594 * Display the "Disconnect Managed Profile" dialog. |
| 581 * @private | 595 * @private |
| 582 */ | 596 */ |
| 583 showDisconnectManagedProfileDialog_: function(replacements) { | 597 showDisconnectManagedProfileDialog_: function(replacements) { |
| 584 loadTimeData.overrideValues(replacements); | 598 loadTimeData.overrideValues(replacements); |
| 585 $('manage-profile-overlay-create').hidden = true; | 599 $('manage-profile-overlay-create').hidden = true; |
| 586 $('manage-profile-overlay-manage').hidden = true; | 600 $('manage-profile-overlay-manage').hidden = true; |
| 587 $('manage-profile-overlay-delete').hidden = true; | 601 $('manage-profile-overlay-delete').hidden = true; |
| 588 $('disconnect-managed-profile-domain-information').innerHTML = | 602 $('disconnect-managed-profile-domain-information').innerHTML = |
| 589 loadTimeData.getString('disconnectManagedProfileDomainInformation'); | 603 loadTimeData.getString('disconnectManagedProfileDomainInformation'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 608 // Forward public APIs to private implementations. | 622 // Forward public APIs to private implementations. |
| 609 cr.makePublic(ManageProfileOverlay, [ | 623 cr.makePublic(ManageProfileOverlay, [ |
| 610 'receiveDefaultProfileIconsAndNames', | 624 'receiveDefaultProfileIconsAndNames', |
| 611 'receiveNewProfileDefaults', | 625 'receiveNewProfileDefaults', |
| 612 'receiveExistingProfileNames', | 626 'receiveExistingProfileNames', |
| 613 'receiveHasProfileShortcuts', | 627 'receiveHasProfileShortcuts', |
| 614 'setProfileInfo', | 628 'setProfileInfo', |
| 615 'setProfileName', | 629 'setProfileName', |
| 616 'showManageDialog', | 630 'showManageDialog', |
| 617 'showDeleteDialog', | 631 'showDeleteDialog', |
| 632 'updateDeleteDialog', |
| 618 'showDisconnectManagedProfileDialog', | 633 'showDisconnectManagedProfileDialog', |
| 619 'showCreateDialog', | 634 'showCreateDialog', |
| 620 ]); | 635 ]); |
| 621 | 636 |
| 622 function CreateProfileOverlay() { | 637 function CreateProfileOverlay() { |
| 623 Page.call(this, 'createProfile', | 638 Page.call(this, 'createProfile', |
| 624 loadTimeData.getString('createProfileTabTitle'), | 639 loadTimeData.getString('createProfileTabTitle'), |
| 625 'manage-profile-overlay'); | 640 'manage-profile-overlay'); |
| 626 }; | 641 }; |
| 627 | 642 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 'updateSignedInStatus', | 890 'updateSignedInStatus', |
| 876 'updateSupervisedUsersAllowed', | 891 'updateSupervisedUsersAllowed', |
| 877 ]); | 892 ]); |
| 878 | 893 |
| 879 // Export | 894 // Export |
| 880 return { | 895 return { |
| 881 ManageProfileOverlay: ManageProfileOverlay, | 896 ManageProfileOverlay: ManageProfileOverlay, |
| 882 CreateProfileOverlay: CreateProfileOverlay, | 897 CreateProfileOverlay: CreateProfileOverlay, |
| 883 }; | 898 }; |
| 884 }); | 899 }); |
| OLD | NEW |