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 Page = cr.ui.pageManager.Page; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
8 | 8 |
9 /** | 9 /** |
10 * Encapsulated handling of a search bubble. | 10 * Encapsulated handling of a search bubble. |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 event.stopPropagation(); | 562 event.stopPropagation(); |
563 event.preventDefault(); | 563 event.preventDefault(); |
564 } | 564 } |
565 break; | 565 break; |
566 } | 566 } |
567 }, | 567 }, |
568 }; | 568 }; |
569 | 569 |
570 /** | 570 /** |
571 * Standardizes a user-entered text query by removing extra whitespace. | 571 * Standardizes a user-entered text query by removing extra whitespace. |
572 * @param {string} The user-entered text. | 572 * @param {string} text The user-entered text. |
573 * @return {string} The trimmed query. | 573 * @return {string} The trimmed query. |
574 */ | 574 */ |
575 SearchPage.canonicalizeQuery = function(text) { | 575 SearchPage.canonicalizeQuery = function(text) { |
576 // Trim beginning and ending whitespace. | 576 // Trim beginning and ending whitespace. |
577 return text.replace(/^\s+|\s+$/g, ''); | 577 return text.replace(/^\s+|\s+$/g, ''); |
578 }; | 578 }; |
579 | 579 |
580 // Export | 580 // Export |
581 return { | 581 return { |
582 SearchPage: SearchPage | 582 SearchPage: SearchPage |
583 }; | 583 }; |
584 | 584 |
585 }); | 585 }); |
OLD | NEW |