| 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 ///////////////////////////////////////////////////////////////////////////// | 6 ///////////////////////////////////////////////////////////////////////////// |
| 7 // OptionsPage class: | 7 // OptionsPage class: |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Base class for options page. | 10 * Base class for options page. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * Offset of page container in pixels, to allow room for side menu. | 37 * Offset of page container in pixels, to allow room for side menu. |
| 38 * Simplified settings pages can override this if they don't use the menu. | 38 * Simplified settings pages can override this if they don't use the menu. |
| 39 * The default (155) comes from -webkit-margin-start in uber_shared.css | 39 * The default (155) comes from -webkit-margin-start in uber_shared.css |
| 40 * @private | 40 * @private |
| 41 */ | 41 */ |
| 42 OptionsPage.horizontalOffset = 155; | 42 OptionsPage.horizontalOffset = 155; |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * True if SettingsApp features are enabled for the options page. |
| 46 * @private |
| 47 */ |
| 48 OptionsPage.settingsApp_ = false; |
| 49 |
| 50 /** |
| 45 * Main level option pages. Maps lower-case page names to the respective page | 51 * Main level option pages. Maps lower-case page names to the respective page |
| 46 * object. | 52 * object. |
| 47 * @protected | 53 * @protected |
| 48 */ | 54 */ |
| 49 OptionsPage.registeredPages = {}; | 55 OptionsPage.registeredPages = {}; |
| 50 | 56 |
| 51 /** | 57 /** |
| 52 * Pages which are meant to behave like modal dialogs. Maps lower-case overlay | 58 * Pages which are meant to behave like modal dialogs. Maps lower-case overlay |
| 53 * names to the respective overlay object. | 59 * names to the respective overlay object. |
| 54 * @protected | 60 * @protected |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 OptionsPage.setPepperFlashSettingsEnabled = function(enabled) { | 717 OptionsPage.setPepperFlashSettingsEnabled = function(enabled) { |
| 712 if (enabled) { | 718 if (enabled) { |
| 713 document.documentElement.setAttribute( | 719 document.documentElement.setAttribute( |
| 714 'enablePepperFlashSettings', ''); | 720 'enablePepperFlashSettings', ''); |
| 715 } else { | 721 } else { |
| 716 document.documentElement.removeAttribute( | 722 document.documentElement.removeAttribute( |
| 717 'enablePepperFlashSettings'); | 723 'enablePepperFlashSettings'); |
| 718 } | 724 } |
| 719 }; | 725 }; |
| 720 | 726 |
| 727 OptionsPage.setIsSettingsApp = function() { |
| 728 OptionsPage.settingsApp_ = true; |
| 729 }; |
| 730 |
| 731 OptionsPage.isSettingsApp = function() { |
| 732 return OptionsPage.settingsApp_; |
| 733 }; |
| 734 |
| 721 OptionsPage.prototype = { | 735 OptionsPage.prototype = { |
| 722 __proto__: cr.EventTarget.prototype, | 736 __proto__: cr.EventTarget.prototype, |
| 723 | 737 |
| 724 /** | 738 /** |
| 725 * The parent page of this option page, or null for top-level pages. | 739 * The parent page of this option page, or null for top-level pages. |
| 726 * @type {OptionsPage} | 740 * @type {OptionsPage} |
| 727 */ | 741 */ |
| 728 parentPage: null, | 742 parentPage: null, |
| 729 | 743 |
| 730 /** | 744 /** |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 canShowPage: function() { | 957 canShowPage: function() { |
| 944 return true; | 958 return true; |
| 945 }, | 959 }, |
| 946 }; | 960 }; |
| 947 | 961 |
| 948 // Export | 962 // Export |
| 949 return { | 963 return { |
| 950 OptionsPage: OptionsPage | 964 OptionsPage: OptionsPage |
| 951 }; | 965 }; |
| 952 }); | 966 }); |
| OLD | NEW |