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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 * @param {string} pageName Page name. | 72 * @param {string} pageName Page name. |
73 * @param {boolean} updateHistory True if we should update the history after | 73 * @param {boolean} updateHistory True if we should update the history after |
74 * showing the page. | 74 * showing the page. |
75 * @param {Object=} opt_propertyBag An optional bag of properties including | 75 * @param {Object=} opt_propertyBag An optional bag of properties including |
76 * replaceState (if history state should be replaced instead of pushed). | 76 * replaceState (if history state should be replaced instead of pushed). |
77 * @private | 77 * @private |
78 */ | 78 */ |
79 OptionsPage.showPageByName = function(pageName, | 79 OptionsPage.showPageByName = function(pageName, |
80 updateHistory, | 80 updateHistory, |
81 opt_propertyBag) { | 81 opt_propertyBag) { |
82 | |
csilv
2012/08/09 18:18:04
intentional newline? (revert?)
| |
82 // If |opt_propertyBag| is non-truthy, homogenize to object. | 83 // If |opt_propertyBag| is non-truthy, homogenize to object. |
83 opt_propertyBag = opt_propertyBag || {}; | 84 opt_propertyBag = opt_propertyBag || {}; |
84 | 85 |
85 // Find the currently visible root-level page. | 86 // Find the currently visible root-level page. |
86 var rootPage = null; | 87 var rootPage = null; |
87 for (var name in this.registeredPages) { | 88 for (var name in this.registeredPages) { |
88 var page = this.registeredPages[name]; | 89 var page = this.registeredPages[name]; |
89 if (page.visible && !page.parentPage) { | 90 if (page.visible && !page.parentPage) { |
90 rootPage = page; | 91 rootPage = page; |
91 break; | 92 break; |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
899 canShowPage: function() { | 900 canShowPage: function() { |
900 return true; | 901 return true; |
901 }, | 902 }, |
902 }; | 903 }; |
903 | 904 |
904 // Export | 905 // Export |
905 return { | 906 return { |
906 OptionsPage: OptionsPage | 907 OptionsPage: OptionsPage |
907 }; | 908 }; |
908 }); | 909 }); |
OLD | NEW |