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 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * Encapsulated handling of a search bubble. | 9 * Encapsulated handling of a search bubble. |
10 * @constructor | 10 * @constructor |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Inherit SearchPage from OptionsPage. | 125 // Inherit SearchPage from OptionsPage. |
126 __proto__: OptionsPage.prototype, | 126 __proto__: OptionsPage.prototype, |
127 | 127 |
128 /** | 128 /** |
129 * A boolean to prevent recursion. Used by setSearchText_(). | 129 * A boolean to prevent recursion. Used by setSearchText_(). |
130 * @type {boolean} | 130 * @type {boolean} |
131 * @private | 131 * @private |
132 */ | 132 */ |
133 insideSetSearchText_: false, | 133 insideSetSearchText_: false, |
134 | 134 |
135 /** | 135 /** @override */ |
136 * Initialize the page. | |
137 */ | |
138 initializePage: function() { | 136 initializePage: function() { |
139 // Call base class implementation to start preference initialization. | 137 // Call base class implementation to start preference initialization. |
140 OptionsPage.prototype.initializePage.call(this); | 138 OptionsPage.prototype.initializePage.call(this); |
141 | 139 |
142 this.searchField = $('search-field'); | 140 this.searchField = $('search-field'); |
143 | 141 |
144 // Handle search events. (No need to throttle, WebKit's search field | 142 // Handle search events. (No need to throttle, WebKit's search field |
145 // will do that automatically.) | 143 // will do that automatically.) |
146 this.searchField.onsearch = function(e) { | 144 this.searchField.onsearch = function(e) { |
147 this.setSearchText_(e.currentTarget.value); | 145 this.setSearchText_(e.currentTarget.value); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 // Trim beginning and ending whitespace. | 566 // Trim beginning and ending whitespace. |
569 return text.replace(/^\s+|\s+$/g, ''); | 567 return text.replace(/^\s+|\s+$/g, ''); |
570 }; | 568 }; |
571 | 569 |
572 // Export | 570 // Export |
573 return { | 571 return { |
574 SearchPage: SearchPage | 572 SearchPage: SearchPage |
575 }; | 573 }; |
576 | 574 |
577 }); | 575 }); |
OLD | NEW |