Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: chrome/browser/resources/settings/basic_page/basic_page.js

Issue 2617663002: WIP: run clang-format-js on lots of things (Closed)
Patch Set: merge Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 * sections. 93 * sections.
94 * @param {string} query The text to search for. 94 * @param {string} query The text to search for.
95 * @return {!Promise<!settings.SearchRequest>} A signal indicating that 95 * @return {!Promise<!settings.SearchRequest>} A signal indicating that
96 * searching finished. 96 * searching finished.
97 */ 97 */
98 searchContents: function(query) { 98 searchContents: function(query) {
99 var whenSearchDone = settings.getSearchManager().search( 99 var whenSearchDone = settings.getSearchManager().search(
100 query, assert(this.$$('#basicPage'))); 100 query, assert(this.$$('#basicPage')));
101 101
102 if (this.pageVisibility.advancedSettings !== false) { 102 if (this.pageVisibility.advancedSettings !== false) {
103 assert(whenSearchDone === settings.getSearchManager().search( 103 assert(
104 query, assert(this.$$('#advancedPage')))); 104 whenSearchDone ===
105 settings.getSearchManager().search(
106 query, assert(this.$$('#advancedPage'))));
105 } 107 }
106 108
107 return whenSearchDone; 109 return whenSearchDone;
108 }, 110 },
109 111
110 /** @private */ 112 /** @private */
111 onResetDone_: function() { 113 onResetDone_: function() {
112 this.showResetProfileBanner_ = false; 114 this.showResetProfileBanner_ = false;
113 }, 115 },
114 116
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 156
155 /** 157 /**
156 * @param {!settings.Route} currentRoute 158 * @param {!settings.Route} currentRoute
157 * @param {boolean} inSearchMode 159 * @param {boolean} inSearchMode
158 * @param {boolean} hasExpandedSection 160 * @param {boolean} hasExpandedSection
159 * @param {boolean} advancedToggleExpanded 161 * @param {boolean} advancedToggleExpanded
160 * @return {boolean} Whether to show the advanced page, taking into account 162 * @return {boolean} Whether to show the advanced page, taking into account
161 * both routing and search state. 163 * both routing and search state.
162 * @private 164 * @private
163 */ 165 */
164 showAdvancedPage_: function(currentRoute, inSearchMode, hasExpandedSection, 166 showAdvancedPage_: function(
165 advancedToggleExpanded) { 167 currentRoute, inSearchMode, hasExpandedSection, advancedToggleExpanded) {
166 return hasExpandedSection ? 168 return hasExpandedSection ? settings.Route.ADVANCED.contains(currentRoute) :
167 settings.Route.ADVANCED.contains(currentRoute) : 169 advancedToggleExpanded || inSearchMode;
168 advancedToggleExpanded || inSearchMode;
169 }, 170 },
170 171
171 /** 172 /**
172 * @param {(boolean|undefined)} visibility 173 * @param {(boolean|undefined)} visibility
173 * @return {boolean} True unless visibility is false. 174 * @return {boolean} True unless visibility is false.
174 * @private 175 * @private
175 */ 176 */
176 showAdvancedSettings_: function(visibility) { 177 showAdvancedSettings_: function(visibility) {
177 return visibility !== false; 178 return visibility !== false;
178 }, 179 },
179 180
180 /** 181 /**
181 * @param {boolean} opened Whether the menu is expanded. 182 * @param {boolean} opened Whether the menu is expanded.
182 * @return {string} Icon name. 183 * @return {string} Icon name.
183 * @private 184 * @private
184 */ 185 */
185 getArrowIcon_: function(opened) { 186 getArrowIcon_: function(opened) {
186 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 187 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
187 }, 188 },
188 }); 189 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698