Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 6 /** |
| 7 * @fileoverview The local InstantExtended NTP and suggestions dropdown. | 7 * @fileoverview The local InstantExtended NTP and suggestions dropdown. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 (function() { | 10 (function() { |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1665 ntpApiHandle.onthemechange = onThemeChange; | 1665 ntpApiHandle.onthemechange = onThemeChange; |
| 1666 ntpApiHandle.onmostvisitedchange = onMostVisitedChange; | 1666 ntpApiHandle.onmostvisitedchange = onMostVisitedChange; |
| 1667 | 1667 |
| 1668 onThemeChange(); | 1668 onThemeChange(); |
| 1669 onMostVisitedChange(); | 1669 onMostVisitedChange(); |
| 1670 | 1670 |
| 1671 searchboxApiHandle = topLevelHandle.searchBox; | 1671 searchboxApiHandle = topLevelHandle.searchBox; |
| 1672 searchboxApiHandle.onnativesuggestions = updateSuggestions; | 1672 searchboxApiHandle.onnativesuggestions = updateSuggestions; |
| 1673 searchboxApiHandle.onchange = updateSuggestions; | 1673 searchboxApiHandle.onchange = updateSuggestions; |
| 1674 searchboxApiHandle.onkeypress = handleKeyPress; | 1674 searchboxApiHandle.onkeypress = handleKeyPress; |
| 1675 // TODO(donnd): consider adding an onfocuschange handler. | |
|
samarth
2013/05/13 20:56:53
Not need to add a TODO here. I don't see a good r
Donn Denman
2013/05/13 23:44:50
Done.
| |
| 1675 // TODO(jered): Re-enable this after http://crbug.com/236492 is fixed. | 1676 // TODO(jered): Re-enable this after http://crbug.com/236492 is fixed. |
| 1676 // searchboxApiHandle.onmarginchange = setSuggestionStyles; | 1677 // searchboxApiHandle.onmarginchange = setSuggestionStyles; |
| 1677 if (window.innerWidth > 0) { | 1678 if (window.innerWidth > 0) { |
| 1678 setSuggestionStyles(); | 1679 setSuggestionStyles(); |
| 1679 } else { | 1680 } else { |
| 1680 // Wait until the overlay is shown to initialize suggestion margins. | 1681 // Wait until the overlay is shown to initialize suggestion margins. |
| 1681 window.addEventListener('resize', setSuggestionStyles); | 1682 window.addEventListener('resize', setSuggestionStyles); |
| 1682 } | 1683 } |
| 1683 searchboxApiHandle.onsubmit = function() { | 1684 searchboxApiHandle.onsubmit = function() { |
| 1684 var value = searchboxApiHandle.value; | 1685 var value = searchboxApiHandle.value; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1705 } | 1706 } |
| 1706 } | 1707 } |
| 1707 | 1708 |
| 1708 document.addEventListener('DOMContentLoaded', init); | 1709 document.addEventListener('DOMContentLoaded', init); |
| 1709 window.addEventListener('message', handleMessage, false); | 1710 window.addEventListener('message', handleMessage, false); |
| 1710 window.addEventListener('blur', function() { | 1711 window.addEventListener('blur', function() { |
| 1711 if (activeBox) | 1712 if (activeBox) |
| 1712 activeBox.clearHover(); | 1713 activeBox.clearHover(); |
| 1713 }, false); | 1714 }, false); |
| 1714 })(); | 1715 })(); |
| OLD | NEW |