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 package org.chromium.chrome.browser.omnibox; | 5 package org.chromium.chrome.browser.omnibox; |
6 | 6 |
7 import org.chromium.chrome.browser.profiles.Profile; | 7 import org.chromium.chrome.browser.profiles.Profile; |
8 import org.chromium.chrome.browser.tab.Tab; | 8 import org.chromium.chrome.browser.tab.Tab; |
9 | 9 |
10 /** | 10 /** |
11 * Java bridge to handle conditional prerendering using autocomplete results * a
s the user types | 11 * Java bridge to handle conditional prerendering using autocomplete results * a
s the user types |
12 * into the Omnibox. | 12 * into the Omnibox. |
13 * | 13 * |
14 * OmniboxPrerender takes keystrokes, autocomplete results and navigation action
s then feeds | 14 * OmniboxPrerender takes keystrokes, autocomplete results and navigation action
s then feeds |
15 * them to the (native) AutocompleteActionPredictor. The predictor uses this dat
a to update its | 15 * them to the (native) AutocompleteActionPredictor. The predictor uses this dat
a to update its |
16 * database and returns predictions on what page, if any, to pre-render or pre-c
onnect. | 16 * database and returns predictions on what page, if any, to pre-render or pre-c
onnect. |
17 * | 17 * |
18 */ | 18 */ |
19 public class OmniboxPrerender { | 19 public class OmniboxPrerender { |
20 private long mNativeOmniboxPrerender = 0; | 20 private long mNativeOmniboxPrerender; |
21 | 21 |
22 /** | 22 /** |
23 * Constructor for creating a OmniboxPrerender instanace. | 23 * Constructor for creating a OmniboxPrerender instanace. |
24 */ | 24 */ |
25 public OmniboxPrerender() { | 25 public OmniboxPrerender() { |
26 mNativeOmniboxPrerender = nativeInit(); | 26 mNativeOmniboxPrerender = nativeInit(); |
27 } | 27 } |
28 | 28 |
29 /** | 29 /** |
30 * Clears the transitional matches. This should be called when the user stop
s typing into | 30 * Clears the transitional matches. This should be called when the user stop
s typing into |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 private native long nativeInit(); | 67 private native long nativeInit(); |
68 private native void nativeClear(long nativeOmniboxPrerender, Profile profile
); | 68 private native void nativeClear(long nativeOmniboxPrerender, Profile profile
); |
69 private native void nativeInitializeForProfile( | 69 private native void nativeInitializeForProfile( |
70 long nativeOmniboxPrerender, | 70 long nativeOmniboxPrerender, |
71 Profile profile); | 71 Profile profile); |
72 private native void nativePrerenderMaybe(long nativeOmniboxPrerender, String
url, | 72 private native void nativePrerenderMaybe(long nativeOmniboxPrerender, String
url, |
73 String currentUrl, long nativeAutocompleteResult, Profile profile, | 73 String currentUrl, long nativeAutocompleteResult, Profile profile, |
74 Tab tab); | 74 Tab tab); |
75 } | 75 } |
OLD | NEW |