Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5179)

Unified Diff: chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js

Issue 11833043: Instant Extended: Fallback to local preview if the remote instant page is not ready on user input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: Addressing sreeram's comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/instant/instant_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
diff --git a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
index fa44d0edc374e3ba0fd596d61981c18da1c17050..c91b7f3eb283683107dea281be6d64664fe18518 100644
--- a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
+++ b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
@@ -145,12 +145,6 @@ function updateSelectedSuggestion(increment) {
* chrome.searchBox.onnativesuggestions implementation.
*/
function handleNativeSuggestions() {
- // This can't be done in setUpApi(), because apiHandle.font/fontSize
- // isn't available yet.
- var suggestionStyleNode = $('suggestionStyle');
- if (!suggestionStyleNode)
- appendSuggestionStyles();
-
var apiHandle = getApiObjectHandle();
// Used to workaround repeated undesired asynchronous onnativesuggestions
@@ -234,6 +228,10 @@ function setUpApi() {
apiHandle.onnativesuggestions = handleNativeSuggestions;
apiHandle.onkeypress = handleKeyPress;
apiHandle.onsubmit = onSubmit;
+ appendSuggestionStyles();
+
+ if (apiHandle.nativeSuggestions.length)
+ handleNativeSuggestions();
}
document.addEventListener('DOMContentLoaded', setUpApi);
« no previous file with comments | « chrome/browser/instant/instant_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698