OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |