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

COVERAGE SUMMARY FOR SOURCE FILE [InterstitialPageDelegateAndroid.java]

nameclass, %method, %block, %line, %
InterstitialPageDelegateAndroid.java100% (1/1)62%  (5/8)71%  (24/34)69%  (9/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InterstitialPageDelegateAndroid100% (1/1)62%  (5/8)71%  (24/34)69%  (9/13)
commandReceived (String): void 0%   (0/1)0%   (0/1)0%   (0/1)
dontProceed (): void 0%   (0/1)0%   (0/8)0%   (0/2)
onDontProceed (): void 0%   (0/1)0%   (0/1)0%   (0/1)
InterstitialPageDelegateAndroid (String): void 100% (1/1)100% (8/8)100% (3/3)
getNative (): int 100% (1/1)100% (3/3)100% (1/1)
onNativeDestroyed (): void 100% (1/1)100% (4/4)100% (2/2)
onProceed (): void 100% (1/1)100% (1/1)100% (1/1)
proceed (): void 100% (1/1)100% (8/8)100% (2/2)

1// Copyright (c) 2012 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.content.browser;
6 
7import org.chromium.base.CalledByNative;
8import org.chromium.base.JNINamespace;
9 
10/**
11 * Allows the specification and handling of Interstitial pages in java.
12 */
13@JNINamespace("content")
14public class InterstitialPageDelegateAndroid {
15 
16    private int mNativePtr;
17 
18    /**
19     * Constructs an interstitial with the given HTML content.
20     *
21     * @param htmlContent The HTML content for the interstitial.
22     */
23    public InterstitialPageDelegateAndroid(String htmlContent) {
24        mNativePtr = nativeInit(htmlContent);
25    }
26 
27    /**
28     * @return The pointer to the underlying native counterpart.
29     */
30    public int getNative() {
31        return mNativePtr;
32    }
33 
34    /**
35     * Called when "proceed" is triggered on the interstitial.
36     */
37    @CalledByNative
38    protected void onProceed() {
39    }
40 
41    /**
42     * Called when "dont' proceed" is triggered on the interstitial.
43     */
44    @CalledByNative
45    protected void onDontProceed() {
46    }
47 
48    /**
49     * Called when a command has been received from the interstitial.
50     *
51     * @param command The command that was received.
52     */
53    @CalledByNative
54    protected void commandReceived(String command) {
55    }
56 
57    @CalledByNative
58    private void onNativeDestroyed() {
59        mNativePtr = 0;
60    }
61 
62    /**
63     * Notifies the native interstitial to proceed.
64     */
65    protected void proceed() {
66        if (mNativePtr != 0) nativeProceed(mNativePtr);
67    }
68 
69    /**
70     * Notifies the native interstitial to not proceed.
71     */
72    protected void dontProceed() {
73        if (mNativePtr != 0) nativeDontProceed(mNativePtr);
74    }
75 
76    private native int nativeInit(String htmlContent);
77    private native void nativeProceed(int nativeInterstitialPageDelegateAndroid);
78    private native void nativeDontProceed(int nativeInterstitialPageDelegateAndroid);
79}

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