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 if (loadTimeData.getBoolean('managedUsersEnabled')) { | 5 if (loadTimeData.getBoolean('managedUsersEnabled')) { |
6 | 6 |
7 cr.define('options', function() { | 7 cr.define('options', function() { |
| 8 /** @const */ var OptionsPage = options.OptionsPage; |
8 /** @const */ var SettingsDialog = options.SettingsDialog; | 9 /** @const */ var SettingsDialog = options.SettingsDialog; |
9 | 10 |
10 ////////////////////////////////////////////////////////////////////////////// | 11 ////////////////////////////////////////////////////////////////////////////// |
11 // ManagedUserSettings class: | 12 // ManagedUserSettings class: |
12 | 13 |
13 /** | 14 /** |
14 * Encapsulated handling of the Managed User Settings page. | 15 * Encapsulated handling of the Managed User Settings page. |
15 * @constructor | 16 * @constructor |
16 * @class | 17 * @class |
17 */ | 18 */ |
(...skipping 19 matching lines...) Expand all Loading... |
37 */ | 38 */ |
38 initializePage: function() { | 39 initializePage: function() { |
39 // Call base class implementation to start preference initialization. | 40 // Call base class implementation to start preference initialization. |
40 SettingsDialog.prototype.initializePage.call(this); | 41 SettingsDialog.prototype.initializePage.call(this); |
41 | 42 |
42 $('get-content-packs-button').onclick = function(event) { | 43 $('get-content-packs-button').onclick = function(event) { |
43 window.open(loadTimeData.getString('getContentPacksURL')); | 44 window.open(loadTimeData.getString('getContentPacksURL')); |
44 }; | 45 }; |
45 | 46 |
46 $('set-passphrase').onclick = function() { | 47 $('set-passphrase').onclick = function() { |
47 // TODO(bauerb): Set passphrase | 48 OptionsPage.navigateToPage('setPassphrase'); |
48 }; | 49 }; |
49 | 50 |
50 }, | 51 }, |
51 /** @override */ | 52 /** @override */ |
52 handleConfirm: function() { | 53 handleConfirm: function() { |
53 chrome.send('confirmManagedUserSettings'); | 54 chrome.send('confirmManagedUserSettings'); |
54 SettingsDialog.prototype.handleConfirm.call(this); | 55 SettingsDialog.prototype.handleConfirm.call(this); |
55 }, | 56 }, |
56 }; | 57 }; |
57 | 58 |
| 59 var ManagedUserSettingsForTesting = { |
| 60 getSetPassphraseButton: function() { |
| 61 return $('set-passphrase'); |
| 62 } |
| 63 }; |
| 64 |
58 // Export | 65 // Export |
59 return { | 66 return { |
60 ManagedUserSettings: ManagedUserSettings | 67 ManagedUserSettings: ManagedUserSettings, |
| 68 ManagedUserSettingsForTesting: ManagedUserSettingsForTesting |
61 }; | 69 }; |
62 }); | 70 }); |
63 | 71 |
64 } | 72 } |
OLD | NEW |