OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Page = cr.ui.pageManager.Page; |
| 7 var PageManager = cr.ui.pageManager.PageManager; |
7 | 8 |
8 /** | 9 /** |
9 * ConsumerManagementOverlay class | 10 * ConsumerManagementOverlay class |
10 * Dialog that allows users to enroll/unenroll consumer management service. | 11 * Dialog that allows users to enroll/unenroll consumer management service. |
11 * @extends {SettingsDialog} | 12 * @extends {SettingsDialog} |
12 * @constructor | 13 * @constructor |
13 */ | 14 */ |
14 function ConsumerManagementOverlay() { | 15 function ConsumerManagementOverlay() { |
15 OptionsPage.call( | 16 Page.call(this, 'consumer-management-overlay', |
16 this, 'consumer-management-overlay', | 17 loadTimeData.getString('consumerManagementOverlayTabTitle'), |
17 loadTimeData.getString('consumerManagementOverlayTabTitle'), | 18 'consumer-management-overlay'); |
18 'consumer-management-overlay'); | |
19 | 19 |
20 var isEnrolled = loadTimeData.getBoolean('consumerManagementEnrolled'); | 20 var isEnrolled = loadTimeData.getBoolean('consumerManagementEnrolled'); |
21 $('enroll-content').hidden = isEnrolled; | 21 $('enroll-content').hidden = isEnrolled; |
22 $('unenroll-content').hidden = !isEnrolled; | 22 $('unenroll-content').hidden = !isEnrolled; |
23 | 23 |
24 $('consumer-management-overlay-enroll').onclick = function(event) { | 24 $('consumer-management-overlay-enroll').onclick = function(event) { |
25 chrome.send('enrollConsumerManagement'); | 25 chrome.send('enrollConsumerManagement'); |
26 OptionsPage.closeOverlay(); | 26 PageManager.closeOverlay(); |
27 }; | 27 }; |
28 $('consumer-management-overlay-unenroll').onclick = function(event) { | 28 $('consumer-management-overlay-unenroll').onclick = function(event) { |
29 chrome.send('unenrollConsumerManagement'); | 29 chrome.send('unenrollConsumerManagement'); |
30 OptionsPage.closeOverlay(); | 30 PageManager.closeOverlay(); |
31 }; | 31 }; |
32 $('consumer-management-overlay-enroll-cancel').onclick = function(event) { | 32 $('consumer-management-overlay-enroll-cancel').onclick = function(event) { |
33 OptionsPage.closeOverlay(); | 33 PageManager.closeOverlay(); |
34 }; | 34 }; |
35 $('consumer-management-overlay-unenroll-cancel').onclick = function(event) { | 35 $('consumer-management-overlay-unenroll-cancel').onclick = function(event) { |
36 OptionsPage.closeOverlay(); | 36 PageManager.closeOverlay(); |
37 }; | 37 }; |
38 } | 38 } |
39 | 39 |
40 cr.addSingletonGetter(ConsumerManagementOverlay); | 40 cr.addSingletonGetter(ConsumerManagementOverlay); |
41 | 41 |
42 ConsumerManagementOverlay.prototype = { | 42 ConsumerManagementOverlay.prototype = { |
43 __proto__: OptionsPage.prototype, | 43 __proto__: Page.prototype, |
44 }; | 44 }; |
45 | 45 |
46 // Export | 46 // Export |
47 return { | 47 return { |
48 ConsumerManagementOverlay: ConsumerManagementOverlay | 48 ConsumerManagementOverlay: ConsumerManagementOverlay |
49 }; | 49 }; |
50 }); | 50 }); |
OLD | NEW |