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 OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 /** | 9 /** |
10 * ManageProfileOverlay class | 10 * ManageProfileOverlay class |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // List of default profile names corresponding to the respective icons. | 35 // List of default profile names corresponding to the respective icons. |
36 defaultProfileNames_: [], | 36 defaultProfileNames_: [], |
37 | 37 |
38 // An object containing all names of existing profiles. | 38 // An object containing all names of existing profiles. |
39 existingProfileNames_: {}, | 39 existingProfileNames_: {}, |
40 | 40 |
41 // The currently selected icon in the icon grid. | 41 // The currently selected icon in the icon grid. |
42 iconGridSelectedURL_: null, | 42 iconGridSelectedURL_: null, |
43 | 43 |
44 /** | 44 /** @override */ |
45 * Initialize the page. | |
46 */ | |
47 initializePage: function() { | 45 initializePage: function() { |
48 // Call base class implementation to start preference initialization. | 46 // Call base class implementation to start preference initialization. |
49 OptionsPage.prototype.initializePage.call(this); | 47 OptionsPage.prototype.initializePage.call(this); |
50 | 48 |
51 var self = this; | 49 var self = this; |
52 options.ProfilesIconGrid.decorate($('manage-profile-icon-grid')); | 50 options.ProfilesIconGrid.decorate($('manage-profile-icon-grid')); |
53 options.ProfilesIconGrid.decorate($('create-profile-icon-grid')); | 51 options.ProfilesIconGrid.decorate($('create-profile-icon-grid')); |
54 self.registerCommonEventHandlers_('create', | 52 self.registerCommonEventHandlers_('create', |
55 self.submitCreateProfile_.bind(self)); | 53 self.submitCreateProfile_.bind(self)); |
56 self.registerCommonEventHandlers_('manage', | 54 self.registerCommonEventHandlers_('manage', |
(...skipping 25 matching lines...) Expand all Loading... |
82 chrome.send('addProfileShortcut', [self.profileInfo_.filePath]); | 80 chrome.send('addProfileShortcut', [self.profileInfo_.filePath]); |
83 }; | 81 }; |
84 $('remove-shortcut-button').onclick = function(event) { | 82 $('remove-shortcut-button').onclick = function(event) { |
85 chrome.send('removeProfileShortcut', [self.profileInfo_.filePath]); | 83 chrome.send('removeProfileShortcut', [self.profileInfo_.filePath]); |
86 }; | 84 }; |
87 | 85 |
88 $('disconnect-managed-profile-ok').onclick = function(event) { | 86 $('disconnect-managed-profile-ok').onclick = function(event) { |
89 OptionsPage.closeOverlay(); | 87 OptionsPage.closeOverlay(); |
90 chrome.send('deleteProfile', | 88 chrome.send('deleteProfile', |
91 [BrowserOptions.getCurrentProfile().filePath]); | 89 [BrowserOptions.getCurrentProfile().filePath]); |
92 } | 90 }; |
93 | 91 |
94 $('create-profile-managed-signed-in-learn-more-link').onclick = | 92 $('create-profile-managed-signed-in-learn-more-link').onclick = |
95 function(event) { | 93 function(event) { |
96 OptionsPage.navigateToPage('managedUserLearnMore'); | 94 OptionsPage.navigateToPage('managedUserLearnMore'); |
97 return false; | 95 return false; |
98 }; | 96 }; |
99 | 97 |
100 $('create-profile-managed-not-signed-in-link').onclick = function(event) { | 98 $('create-profile-managed-not-signed-in-link').onclick = function(event) { |
101 // The signin process will open an overlay to configure sync, which | 99 // The signin process will open an overlay to configure sync, which |
102 // would replace this overlay. It's smoother to close this one now. | 100 // would replace this overlay. It's smoother to close this one now. |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 return instance[name + '_'].apply(instance, arguments); | 851 return instance[name + '_'].apply(instance, arguments); |
854 }; | 852 }; |
855 }); | 853 }); |
856 | 854 |
857 // Export | 855 // Export |
858 return { | 856 return { |
859 ManageProfileOverlay: ManageProfileOverlay, | 857 ManageProfileOverlay: ManageProfileOverlay, |
860 CreateProfileOverlay: CreateProfileOverlay, | 858 CreateProfileOverlay: CreateProfileOverlay, |
861 }; | 859 }; |
862 }); | 860 }); |
OLD | NEW |