| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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('settings', function() { | 5 cr.define('settings', function() { |
| 6 /** @const {string} */ | 6 /** @const {string} */ |
| 7 var WRAPPER_CSS_CLASS = 'search-highlight-wrapper'; | 7 var WRAPPER_CSS_CLASS = 'search-highlight-wrapper'; |
| 8 | 8 |
| 9 /** @const {string} */ | 9 /** @const {string} */ |
| 10 var HIT_CSS_CLASS = 'search-highlight-hit'; | 10 var HIT_CSS_CLASS = 'search-highlight-hit'; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return; | 188 return; |
| 189 | 189 |
| 190 searchBubble = document.createElement('div'); | 190 searchBubble = document.createElement('div'); |
| 191 searchBubble.classList.add(SEARCH_BUBBLE_CSS_CLASS); | 191 searchBubble.classList.add(SEARCH_BUBBLE_CSS_CLASS); |
| 192 var innards = document.createElement('div'); | 192 var innards = document.createElement('div'); |
| 193 innards.classList.add('search-bubble-innards'); | 193 innards.classList.add('search-bubble-innards'); |
| 194 innards.textContent = rawQuery; | 194 innards.textContent = rawQuery; |
| 195 searchBubble.appendChild(innards); | 195 searchBubble.appendChild(innards); |
| 196 element.appendChild(searchBubble); | 196 element.appendChild(searchBubble); |
| 197 | 197 |
| 198 // Dynamically position the bubble at the edge the associated controle | 198 // Dynamically position the bubble at the edge the associated control |
| 199 // elemnt. | 199 // element. |
| 200 searchBubble.style.left = '-' + searchBubble.offsetWidth + 'px'; | 200 searchBubble.style.top = element.offsetTop + element.offsetHeight + 'px'; |
| 201 } | 201 } |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * Finds and makes visible the <settings-section> parent of |node|. | 204 * Finds and makes visible the <settings-section> parent of |node|. |
| 205 * @param {!Node} node | 205 * @param {!Node} node |
| 206 * @param {string} rawQuery | 206 * @param {string} rawQuery |
| 207 * @private | 207 * @private |
| 208 */ | 208 */ |
| 209 function revealParentSection_(node, rawQuery) { | 209 function revealParentSection_(node, rawQuery) { |
| 210 var associatedControl = null; | 210 var associatedControl = null; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 function setSearchManagerForTesting(searchManager) { | 584 function setSearchManagerForTesting(searchManager) { |
| 585 SearchManagerImpl.instance_ = searchManager; | 585 SearchManagerImpl.instance_ = searchManager; |
| 586 } | 586 } |
| 587 | 587 |
| 588 return { | 588 return { |
| 589 getSearchManager: getSearchManager, | 589 getSearchManager: getSearchManager, |
| 590 setSearchManagerForTesting: setSearchManagerForTesting, | 590 setSearchManagerForTesting: setSearchManagerForTesting, |
| 591 SearchRequest: SearchRequest, | 591 SearchRequest: SearchRequest, |
| 592 }; | 592 }; |
| 593 }); | 593 }); |
| OLD | NEW |