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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java

Issue 2929113002: Enable spare RenderProcessHost to be preinitialized. (Closed)
Patch Set: Omnibox hook Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package org.chromium.chrome.browser.omnibox; 5 package org.chromium.chrome.browser.omnibox;
6 6
7 import android.os.Bundle; 7 import android.os.Bundle;
8 import android.text.TextUtils; 8 import android.text.TextUtils;
9 9
10 import org.chromium.base.VisibleForTesting; 10 import org.chromium.base.VisibleForTesting;
11 import org.chromium.base.annotations.CalledByNative; 11 import org.chromium.base.annotations.CalledByNative;
12 import org.chromium.chrome.browser.WarmupManager;
12 import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.MatchClassification ; 13 import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.MatchClassification ;
13 import org.chromium.chrome.browser.omnibox.VoiceSuggestionProvider.VoiceResult; 14 import org.chromium.chrome.browser.omnibox.VoiceSuggestionProvider.VoiceResult;
14 import org.chromium.chrome.browser.profiles.Profile; 15 import org.chromium.chrome.browser.profiles.Profile;
15 import org.chromium.content_public.browser.WebContents; 16 import org.chromium.content_public.browser.WebContents;
16 17
17 import java.util.ArrayList; 18 import java.util.ArrayList;
18 import java.util.List; 19 import java.util.List;
19 20
20 /** 21 /**
21 * Bridge to the native AutocompleteControllerAndroid. 22 * Bridge to the native AutocompleteControllerAndroid.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 * 147 *
147 * @param profile The profile to use for starting the AutocompleteController . 148 * @param profile The profile to use for starting the AutocompleteController .
148 * @param omniboxText The text displayed in the omnibox. 149 * @param omniboxText The text displayed in the omnibox.
149 * @param url The url of the currently loaded web page. 150 * @param url The url of the currently loaded web page.
150 * @param focusedFromFakebox Whether the user entered the omnibox by tapping the fakebox on the 151 * @param focusedFromFakebox Whether the user entered the omnibox by tapping the fakebox on the
151 * native NTP. This should be false on all other p ages. 152 * native NTP. This should be false on all other p ages.
152 */ 153 */
153 public void startZeroSuggest(Profile profile, String omniboxText, String url , 154 public void startZeroSuggest(Profile profile, String omniboxText, String url ,
154 boolean focusedFromFakebox) { 155 boolean focusedFromFakebox) {
155 if (profile == null || TextUtils.isEmpty(url)) return; 156 if (profile == null || TextUtils.isEmpty(url)) return;
157
158 WarmupManager.getInstance().createSpareRenderProcessHost(profile);
Charlie Reis 2017/06/25 23:48:27 Worth having a comment here saying how the spare p
mattcary 2017/06/26 14:45:05 Done.
159
156 mNativeAutocompleteControllerAndroid = nativeInit(profile); 160 mNativeAutocompleteControllerAndroid = nativeInit(profile);
157 if (mNativeAutocompleteControllerAndroid != 0) { 161 if (mNativeAutocompleteControllerAndroid != 0) {
158 if (mUseCachedZeroSuggestResults) mWaitingForSuggestionsToCache = tr ue; 162 if (mUseCachedZeroSuggestResults) mWaitingForSuggestionsToCache = tr ue;
159 nativeOnOmniboxFocused(mNativeAutocompleteControllerAndroid, omnibox Text, url, 163 nativeOnOmniboxFocused(mNativeAutocompleteControllerAndroid, omnibox Text, url,
160 focusedFromFakebox); 164 focusedFromFakebox);
161 } 165 }
162 } 166 }
163 167
164 /** 168 /**
165 * Stops generating autocomplete suggestions for the currently specified tex t from 169 * Stops generating autocomplete suggestions for the currently specified tex t from
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 * @param query The query to be expanded into a fully qualified URL if appro priate. 367 * @param query The query to be expanded into a fully qualified URL if appro priate.
364 * @return The fully qualified URL or null. 368 * @return The fully qualified URL or null.
365 */ 369 */
366 public static native String nativeQualifyPartialURLQuery(String query); 370 public static native String nativeQualifyPartialURLQuery(String query);
367 371
368 /** 372 /**
369 * Sends a zero suggest request to the server in order to pre-populate the r esult cache. 373 * Sends a zero suggest request to the server in order to pre-populate the r esult cache.
370 */ 374 */
371 public static native void nativePrefetchZeroSuggestResults(); 375 public static native void nativePrefetchZeroSuggestResults();
372 } 376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698