| Index: chrome/browser/resources/options/search_page.js
|
| diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js
|
| index c561a0cccbb1512f574fd0fe700928aa587796ce..3399182567f2bc109ce4721effa48016408cc07e 100644
|
| --- a/chrome/browser/resources/options/search_page.js
|
| +++ b/chrome/browser/resources/options/search_page.js
|
| @@ -155,8 +155,8 @@ cr.define('options', function() {
|
| return;
|
|
|
| // Position the bubble below the location of the owner.
|
| - var left = owner.offsetLeft + owner.offsetWidth / 2 -
|
| - this.offsetWidth / 2;
|
| + var left =
|
| + owner.offsetLeft + owner.offsetWidth / 2 - this.offsetWidth / 2;
|
|
|
| var BUBBLE_EDGE_OFFSET = 5;
|
| var top = owner.offsetTop;
|
| @@ -184,9 +184,9 @@ cr.define('options', function() {
|
| * @extends {cr.ui.pageManager.Page}
|
| */
|
| function SearchPage() {
|
| - Page.call(this, 'search',
|
| - loadTimeData.getString('searchPageTabTitle'),
|
| - 'searchPage');
|
| + Page.call(
|
| + this, 'search', loadTimeData.getString('searchPageTabTitle'),
|
| + 'searchPage');
|
| }
|
|
|
| cr.addSingletonGetter(SearchPage);
|
| @@ -232,8 +232,8 @@ cr.define('options', function() {
|
| }.bind(this);
|
|
|
| // Install handler for key presses.
|
| - document.addEventListener('keydown',
|
| - this.keyDownEventHandler_.bind(this));
|
| + document.addEventListener(
|
| + 'keydown', this.keyDownEventHandler_.bind(this));
|
| },
|
|
|
| /** @override */
|
| @@ -355,7 +355,8 @@ cr.define('options', function() {
|
| return;
|
|
|
| // Prevent recursive execution of this method.
|
| - if (this.insideSetSearchText_) return;
|
| + if (this.insideSetSearchText_)
|
| + return;
|
| this.insideSetSearchText_ = true;
|
|
|
| // Cleanup the search query string.
|
| @@ -371,8 +372,8 @@ cr.define('options', function() {
|
|
|
| if (!this.hasSentFirstSearchTime_) {
|
| this.hasSentFirstSearchTime_ = true;
|
| - chrome.metricsPrivate.recordMediumTime('Settings.TimeToFirstSearch',
|
| - Date.now() - this.createdTimestamp_);
|
| + chrome.metricsPrivate.recordMediumTime(
|
| + 'Settings.TimeToFirstSearch', Date.now() - this.createdTimestamp_);
|
| }
|
|
|
| // Toggle the search page if necessary. Otherwise, update the hash.
|
| @@ -415,16 +416,15 @@ cr.define('options', function() {
|
| // Search all top-level sections for anchored string matches.
|
| for (var i = 0; i < pagesToSearch.length; i++) {
|
| var page = pagesToSearch[i];
|
| - var elements =
|
| - page.pageDiv.querySelectorAll('section');
|
| + var elements = page.pageDiv.querySelectorAll('section');
|
| for (var i = 0, node; node = elements[i]; i++) {
|
| if (this.highlightMatches_(regExp, node)) {
|
| node.classList.remove('search-hidden');
|
| if (!node.hidden) {
|
| foundMatches = true;
|
| pageMatchesForMetrics += 1;
|
| - var section = SettingsSections[node.id] ||
|
| - SettingsSections['Unknown'];
|
| + var section =
|
| + SettingsSections[node.id] || SettingsSections['Unknown'];
|
| sectionMatchesForMetrics[section] = section;
|
| }
|
| }
|
| @@ -462,15 +462,15 @@ cr.define('options', function() {
|
| this.delayedSearchMetric_ = setTimeout(function() {
|
| if (!foundMatches) {
|
| chrome.metricsPrivate.recordSmallCount(
|
| - 'Settings.SearchLengthNoMatch', text.length);
|
| + 'Settings.SearchLengthNoMatch', text.length);
|
| chrome.metricsPrivate.recordSmallCount(
|
| - 'Settings.SearchSections', SettingsSections['None']);
|
| + 'Settings.SearchSections', SettingsSections['None']);
|
| } else {
|
| for (var section in sectionMatchesForMetrics) {
|
| var sectionId = sectionMatchesForMetrics[section];
|
| assert(sectionId !== undefined);
|
| chrome.metricsPrivate.recordSmallCount(
|
| - 'Settings.SearchSections', sectionId);
|
| + 'Settings.SearchSections', sectionId);
|
| }
|
| }
|
|
|
| @@ -528,10 +528,8 @@ cr.define('options', function() {
|
| var div, child, tmp;
|
|
|
| // Walk the tree, searching each TEXT node.
|
| - var walker = document.createTreeWalker(element,
|
| - NodeFilter.SHOW_TEXT,
|
| - null,
|
| - false);
|
| + var walker =
|
| + document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null, false);
|
| var node = walker.nextNode();
|
| while (node) {
|
| var textContent = node.nodeValue;
|
| @@ -594,8 +592,9 @@ cr.define('options', function() {
|
| createSearchBubble_: function(element, text) {
|
| // avoid appending multiple bubbles to a button.
|
| var sibling = element.previousElementSibling;
|
| - if (sibling && (sibling.classList.contains('search-bubble') ||
|
| - sibling.classList.contains('search-bubble-wrapper')))
|
| + if (sibling &&
|
| + (sibling.classList.contains('search-bubble') ||
|
| + sibling.classList.contains('search-bubble-wrapper')))
|
| return;
|
|
|
| var parent = element.parentElement;
|
| @@ -645,16 +644,14 @@ cr.define('options', function() {
|
| var name, pageInfo, page, pages = [];
|
| for (name in PageManager.registeredPages) {
|
| page = PageManager.registeredPages[name];
|
| - if (page.parentPage &&
|
| - page.associatedSection &&
|
| + if (page.parentPage && page.associatedSection &&
|
| !page.associatedSection.hidden) {
|
| pages.push(page);
|
| }
|
| }
|
| for (name in PageManager.registeredOverlayPages) {
|
| page = PageManager.registeredOverlayPages[name];
|
| - if (page.associatedSection &&
|
| - !page.associatedSection.hidden &&
|
| + if (page.associatedSection && !page.associatedSection.hidden &&
|
| page.pageDiv != undefined) {
|
| pages.push(page);
|
| }
|
| @@ -703,8 +700,6 @@ cr.define('options', function() {
|
| };
|
|
|
| // Export
|
| - return {
|
| - SearchPage: SearchPage
|
| - };
|
| + return {SearchPage: SearchPage};
|
|
|
| });
|
|
|