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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 | 54 |
55 $('manage-profile-name').oninput = function(event) { | 55 $('manage-profile-name').oninput = function(event) { |
56 self.onNameChanged_(event, 'manage'); | 56 self.onNameChanged_(event, 'manage'); |
57 }; | 57 }; |
58 $('create-profile-name').oninput = function(event) { | 58 $('create-profile-name').oninput = function(event) { |
59 self.onNameChanged_(event, 'create'); | 59 self.onNameChanged_(event, 'create'); |
60 }; | 60 }; |
61 if (loadTimeData.getBoolean('managedUsersEnabled')) { | 61 if (loadTimeData.getBoolean('managedUsersEnabled')) { |
62 $('create-profile-managed-container').hidden = false; | 62 $('create-profile-managed-container').hidden = false; |
63 $('managed-user-settings-button').onclick = function(event) { | 63 $('managed-user-settings-button').onclick = function(event) { |
64 OptionsPage.navigateToPage('managedUser'); | 64 chrome.send('displayPassphraseDialog', |
65 ['ManageProfileOverlay.showManagedUserSettingsDialog']); | |
Bernhard Bauer
2013/01/07 14:20:22
If our code gets more complicated, we might need t
| |
65 chrome.send('coreOptionsUserMetricsAction', | 66 chrome.send('coreOptionsUserMetricsAction', |
66 ['Options_ManagedUserPassphraseOverlay']); | 67 ['Options_ManagedUserPassphraseOverlay']); |
67 }; | 68 }; |
68 } | 69 } |
69 $('manage-profile-cancel').onclick = | 70 $('manage-profile-cancel').onclick = |
70 $('delete-profile-cancel').onclick = | 71 $('delete-profile-cancel').onclick = |
71 $('create-profile-cancel').onclick = function(event) { | 72 $('create-profile-cancel').onclick = function(event) { |
72 OptionsPage.closeOverlay(); | 73 OptionsPage.closeOverlay(); |
73 }; | 74 }; |
74 $('manage-profile-ok').onclick = function(event) { | 75 $('manage-profile-ok').onclick = function(event) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 OptionsPage.showPageByName('manageProfile', false); | 316 OptionsPage.showPageByName('manageProfile', false); |
316 }, | 317 }, |
317 | 318 |
318 /** | 319 /** |
319 * Display the "Create Profile" dialog. | 320 * Display the "Create Profile" dialog. |
320 * @private | 321 * @private |
321 */ | 322 */ |
322 showCreateDialog_: function() { | 323 showCreateDialog_: function() { |
323 OptionsPage.navigateToPage('createProfile'); | 324 OptionsPage.navigateToPage('createProfile'); |
324 }, | 325 }, |
326 /** Display the "Managed User Settings" dialog. | |
327 * This method is only called if the entered password is correct. | |
328 * @private | |
329 */ | |
330 showManagedUserSettingsDialog_: function() { | |
331 OptionsPage.navigateToPage('managedUser'); | |
Pam (message me for reviews)
2013/01/07 14:51:49
Hm, do we in any way prevent a user from just navi
Bernhard Bauer
2013/01/08 17:43:14
Either that, or ignore any commands that get sent
| |
332 chrome.send('coreOptionsUserMetricsAction', | |
333 ['Options_FamilyControlSettings']); | |
334 }, | |
325 }; | 335 }; |
326 | 336 |
327 // Forward public APIs to private implementations. | 337 // Forward public APIs to private implementations. |
328 [ | 338 [ |
329 'receiveDefaultProfileIcons', | 339 'receiveDefaultProfileIcons', |
330 'receiveNewProfileDefaults', | 340 'receiveNewProfileDefaults', |
331 'receiveProfileNames', | 341 'receiveProfileNames', |
332 'setProfileInfo', | 342 'setProfileInfo', |
333 'setProfileName', | 343 'setProfileName', |
334 'showManageDialog', | 344 'showManageDialog', |
335 'showDeleteDialog', | 345 'showDeleteDialog', |
336 'showCreateDialog', | 346 'showCreateDialog', |
347 'showManagedUserSettingsDialog', | |
337 ].forEach(function(name) { | 348 ].forEach(function(name) { |
338 ManageProfileOverlay[name] = function() { | 349 ManageProfileOverlay[name] = function() { |
339 var instance = ManageProfileOverlay.getInstance(); | 350 var instance = ManageProfileOverlay.getInstance(); |
340 return instance[name + '_'].apply(instance, arguments); | 351 return instance[name + '_'].apply(instance, arguments); |
341 }; | 352 }; |
342 }); | 353 }); |
343 | 354 |
344 function CreateProfileOverlay() { | 355 function CreateProfileOverlay() { |
345 OptionsPage.call(this, 'createProfile', | 356 OptionsPage.call(this, 'createProfile', |
346 loadTimeData.getString('createProfileTabTitle'), | 357 loadTimeData.getString('createProfileTabTitle'), |
(...skipping 28 matching lines...) Expand all Loading... | |
375 $('create-profile-ok').disabled = true; | 386 $('create-profile-ok').disabled = true; |
376 }, | 387 }, |
377 }; | 388 }; |
378 | 389 |
379 // Export | 390 // Export |
380 return { | 391 return { |
381 ManageProfileOverlay: ManageProfileOverlay, | 392 ManageProfileOverlay: ManageProfileOverlay, |
382 CreateProfileOverlay: CreateProfileOverlay, | 393 CreateProfileOverlay: CreateProfileOverlay, |
383 }; | 394 }; |
384 }); | 395 }); |
OLD | NEW |