EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.chrome.browser.omnibox]

COVERAGE SUMMARY FOR SOURCE FILE [OmniboxPrerender.java]

nameclass, %method, %block, %line, %
OmniboxPrerender.java0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OmniboxPrerender0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/10)
OmniboxPrerender (): void 0%   (0/1)0%   (0/10)0%   (0/4)
clear (Profile): void 0%   (0/1)0%   (0/6)0%   (0/2)
initializeForProfile (Profile): void 0%   (0/1)0%   (0/6)0%   (0/2)
prerenderMaybe (String, String, int, Profile, int): void 0%   (0/1)0%   (0/10)0%   (0/2)

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
3// found in the LICENSE file.
4 
5package org.chromium.chrome.browser.omnibox;
6 
7import org.chromium.chrome.browser.profiles.Profile;
8 
9/**
10 * Java bridge to handle conditional prerendering using autocomplete results * as the user types
11 * into the Omnibox.
12 *
13 * OmniboxPrerender takes keystrokes, autocomplete results and navigation actions then feeds
14 * them to the (native) AutocompleteActionPredictor. The predictor uses this data to update its
15 * database and returns predictions on what page, if any, to pre-render or pre-connect.
16 *
17 */
18public class OmniboxPrerender {
19    private int mNativeOmniboxPrerender = 0;
20 
21    /**
22     * Constructor for creating a OmniboxPrerender instanace.
23     */
24    public OmniboxPrerender() {
25        mNativeOmniboxPrerender = nativeInit();
26    }
27 
28    /**
29     * Clears the transitional matches. This should be called when the user stops typing into
30     * the omnibox (e.g. when navigating away, closing the keyboard or changing tabs)
31     *
32     * @param profile profile instance corresponding to the active profile.
33     */
34    public void clear(Profile profile) {
35        nativeClear(mNativeOmniboxPrerender, profile);
36    }
37 
38    /**
39     * Initializes the underlying action predictor for a given profile instance. This should be
40     * called as soon as possible as the predictor must register for certain notifications to
41     * properly initialize before providing predictions and updated its learning database.
42     *
43     * @param profile profile instance corresponding to active profile.
44     */
45    public void initializeForProfile(Profile profile) {
46        nativeInitializeForProfile(mNativeOmniboxPrerender, profile);
47    }
48 
49    /**
50     * Potentailly invokes a pre-render or pre-connect given the url typed into the omnibox and
51     * a corresponding autocomplete result. This should be invoked everytime the omnibox changes
52     * (e.g. As the user types characters this method should be invoked at least once per character)
53     *
54     * @param url url in the omnibox.
55     * @param currentUrl url the current tab is displaying.
56     * @param nativeAutocompleteResult native pointer to an autocomplete result.
57     * @param profile profile instance corresponding to the active profile.
58     * @param nativeWebContents native pointer to a web contents instance.
59     */
60    public void prerenderMaybe(String url, String currentUrl, int nativeAutocompleteResult,
61            Profile profile, int nativeWebContents) {
62        nativePrerenderMaybe(mNativeOmniboxPrerender, url, currentUrl, nativeAutocompleteResult,
63                profile, nativeWebContents);
64    }
65 
66    private native int nativeInit();
67    private native void nativeClear(int nativeOmniboxPrerender, Profile profile);
68    private native void nativeInitializeForProfile(
69            int nativeOmniboxPrerender,
70            Profile profile);
71    private native void nativePrerenderMaybe(int nativeOmniboxPrerender, String url,
72            String currentUrl, int nativeAutocompleteResult, Profile profile,
73            int nativeWebContents);
74}

[all classes][org.chromium.chrome.browser.omnibox]
EMMA 2.0.5312 (C) Vladimir Roubtsov