| 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( |
| 16 this, 'consumer-management-overlay', | 17 this, 'consumer-management-overlay', |
| 17 loadTimeData.getString('consumerManagementOverlayTabTitle'), | 18 loadTimeData.getString('consumerManagementOverlayTabTitle'), |
| 18 'consumer-management-overlay'); | 19 'consumer-management-overlay'); |
| 19 | 20 |
| 20 var isEnrolled = loadTimeData.getBoolean('consumerManagementEnrolled'); | 21 var isEnrolled = loadTimeData.getBoolean('consumerManagementEnrolled'); |
| 21 $('enroll-content').hidden = isEnrolled; | 22 $('enroll-content').hidden = isEnrolled; |
| 22 $('unenroll-content').hidden = !isEnrolled; | 23 $('unenroll-content').hidden = !isEnrolled; |
| 23 | 24 |
| 24 $('consumer-management-overlay-enroll').onclick = function(event) { | 25 $('consumer-management-overlay-enroll').onclick = function(event) { |
| 25 chrome.send('enrollConsumerManagement'); | 26 chrome.send('enrollConsumerManagement'); |
| 26 OptionsPage.closeOverlay(); | 27 PageManager.closeOverlay(); |
| 27 }; | 28 }; |
| 28 $('consumer-management-overlay-unenroll').onclick = function(event) { | 29 $('consumer-management-overlay-unenroll').onclick = function(event) { |
| 29 chrome.send('unenrollConsumerManagement'); | 30 chrome.send('unenrollConsumerManagement'); |
| 30 OptionsPage.closeOverlay(); | 31 PageManager.closeOverlay(); |
| 31 }; | 32 }; |
| 32 $('consumer-management-overlay-enroll-cancel').onclick = function(event) { | 33 $('consumer-management-overlay-enroll-cancel').onclick = function(event) { |
| 33 OptionsPage.closeOverlay(); | 34 PageManager.closeOverlay(); |
| 34 }; | 35 }; |
| 35 $('consumer-management-overlay-unenroll-cancel').onclick = function(event) { | 36 $('consumer-management-overlay-unenroll-cancel').onclick = function(event) { |
| 36 OptionsPage.closeOverlay(); | 37 PageManager.closeOverlay(); |
| 37 }; | 38 }; |
| 38 } | 39 } |
| 39 | 40 |
| 40 cr.addSingletonGetter(ConsumerManagementOverlay); | 41 cr.addSingletonGetter(ConsumerManagementOverlay); |
| 41 | 42 |
| 42 ConsumerManagementOverlay.prototype = { | 43 ConsumerManagementOverlay.prototype = { |
| 43 __proto__: OptionsPage.prototype, | 44 __proto__: Page.prototype, |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // Export | 47 // Export |
| 47 return { | 48 return { |
| 48 ConsumerManagementOverlay: ConsumerManagementOverlay | 49 ConsumerManagementOverlay: ConsumerManagementOverlay |
| 49 }; | 50 }; |
| 50 }); | 51 }); |
| OLD | NEW |