Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-basic-page' is the settings page containing the actual settings. | 7 * 'settings-basic-page' is the settings page containing the actual settings. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-basic-page', | 10 is: 'settings-basic-page', |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Dictionary defining page visibility. | 24 * Dictionary defining page visibility. |
| 25 * @type {!GuestModePageVisibility} | 25 * @type {!GuestModePageVisibility} |
| 26 */ | 26 */ |
| 27 pageVisibility: Object, | 27 pageVisibility: Object, |
| 28 | 28 |
| 29 advancedToggleExpanded: { | 29 advancedToggleExpanded: { |
| 30 type: Boolean, | 30 type: Boolean, |
| 31 notify: true, | 31 notify: true, |
| 32 observer: 'advancedToggleExpandedChanged_', | |
| 32 }, | 33 }, |
| 33 | 34 |
| 34 /** | 35 /** |
| 35 * True if a section is fully expanded to hide other sections beneath it. | 36 * True if a section is fully expanded to hide other sections beneath it. |
| 36 * False otherwise (even while animating a section open/closed). | 37 * False otherwise (even while animating a section open/closed). |
| 37 * @private {boolean} | 38 * @private {boolean} |
| 38 */ | 39 */ |
| 39 hasExpandedSection_: { | 40 hasExpandedSection_: { |
| 40 type: Boolean, | 41 type: Boolean, |
| 41 value: false, | 42 value: false, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 * @param {string} query The text to search for. | 95 * @param {string} query The text to search for. |
| 95 * @return {!Promise<!settings.SearchRequest>} A signal indicating that | 96 * @return {!Promise<!settings.SearchRequest>} A signal indicating that |
| 96 * searching finished. | 97 * searching finished. |
| 97 */ | 98 */ |
| 98 searchContents: function(query) { | 99 searchContents: function(query) { |
| 99 var whenSearchDone = settings.getSearchManager().search( | 100 var whenSearchDone = settings.getSearchManager().search( |
| 100 query, assert(this.$$('#basicPage'))); | 101 query, assert(this.$$('#basicPage'))); |
| 101 | 102 |
| 102 if (this.pageVisibility.advancedSettings !== false) { | 103 if (this.pageVisibility.advancedSettings !== false) { |
| 103 assert(whenSearchDone === settings.getSearchManager().search( | 104 assert(whenSearchDone === settings.getSearchManager().search( |
| 104 query, assert(this.$$('#advancedPage')))); | 105 query, assert(this.$.advancedPageTemplate.get()))); |
| 105 } | 106 } |
| 106 | 107 |
| 107 return whenSearchDone; | 108 return whenSearchDone; |
| 108 }, | 109 }, |
| 109 | 110 |
| 110 /** @private */ | 111 /** @private */ |
| 111 onResetDone_: function() { | 112 onResetDone_: function() { |
| 112 this.showResetProfileBanner_ = false; | 113 this.showResetProfileBanner_ = false; |
| 113 }, | 114 }, |
| 114 | 115 |
| 115 /** | 116 /** |
| 116 * @return {boolean} | 117 * @return {boolean} |
| 117 * @private | 118 * @private |
| 118 */ | 119 */ |
| 119 shouldShowAndroidApps_: function() { | 120 shouldShowAndroidApps_: function() { |
| 120 var visibility = /** @type {boolean|undefined} */ ( | 121 var visibility = /** @type {boolean|undefined} */ ( |
| 121 this.get('pageVisibility.androidApps')); | 122 this.get('pageVisibility.androidApps')); |
| 122 return this.showAndroidApps && this.showPage(visibility); | 123 return this.showAndroidApps && this.showPage(visibility); |
| 123 }, | 124 }, |
| 124 | 125 |
| 125 /** | 126 /** |
| 126 * Hides everything but the newly expanded subpage. | 127 * Hides everything but the newly expanded subpage. |
| 127 * @private | 128 * @private |
| 128 */ | 129 */ |
| 129 onSubpageExpanded_: function() { | 130 onSubpageExpanded_: function() { |
| 130 this.hasExpandedSection_ = true; | 131 this.hasExpandedSection_ = true; |
| 131 }, | 132 }, |
| 132 | 133 |
| 133 /** | 134 /** |
| 135 * Inform the idle render code that the advanced page to load. | |
|
dpapad
2017/01/31 23:10:13
Syntax is confusing, probably something is missing
dschuyler
2017/01/31 23:53:03
Done.
| |
| 136 * @private | |
| 137 */ | |
| 138 advancedToggleExpandedChanged_: function() { | |
| 139 if (this.advancedToggleExpanded) | |
| 140 this.$.advancedPageTemplate.get(); | |
| 141 }, | |
| 142 | |
| 143 /** | |
| 134 * @param {boolean} inSearchMode | 144 * @param {boolean} inSearchMode |
| 135 * @param {boolean} hasExpandedSection | 145 * @param {boolean} hasExpandedSection |
| 136 * @return {boolean} | 146 * @return {boolean} |
| 137 * @private | 147 * @private |
| 138 */ | 148 */ |
| 139 showAdvancedToggle_: function(inSearchMode, hasExpandedSection) { | 149 showAdvancedToggle_: function(inSearchMode, hasExpandedSection) { |
| 140 return !inSearchMode && !hasExpandedSection; | 150 return !inSearchMode && !hasExpandedSection; |
| 141 }, | 151 }, |
| 142 | 152 |
| 143 /** | 153 /** |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 | 189 |
| 180 /** | 190 /** |
| 181 * @param {boolean} opened Whether the menu is expanded. | 191 * @param {boolean} opened Whether the menu is expanded. |
| 182 * @return {string} Icon name. | 192 * @return {string} Icon name. |
| 183 * @private | 193 * @private |
| 184 */ | 194 */ |
| 185 getArrowIcon_: function(opened) { | 195 getArrowIcon_: function(opened) { |
| 186 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | 196 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; |
| 187 }, | 197 }, |
| 188 }); | 198 }); |
| OLD | NEW |