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

COVERAGE SUMMARY FOR SOURCE FILE [ColorChooserAndroid.java]

nameclass, %method, %block, %line, %
ColorChooserAndroid.java0%   (0/2)0%   (0/9)0%   (0/68)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ColorChooserAndroid0%   (0/1)0%   (0/7)0%   (0/50)0%   (0/13)
ColorChooserAndroid (int, Context, int): void 0%   (0/1)0%   (0/19)0%   (0/5)
access$000 (ColorChooserAndroid): ColorPickerDialog 0%   (0/1)0%   (0/3)0%   (0/1)
access$100 (ColorChooserAndroid): int 0%   (0/1)0%   (0/3)0%   (0/1)
access$200 (ColorChooserAndroid, int, int): void 0%   (0/1)0%   (0/5)0%   (0/1)
closeColorChooser (): void 0%   (0/1)0%   (0/4)0%   (0/2)
createColorChooserAndroid (int, ContentViewCore, int): ColorChooserAndroid 0%   (0/1)0%   (0/12)0%   (0/3)
openColorChooser (): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class ColorChooserAndroid$10%   (0/1)0%   (0/2)0%   (0/18)0%   (0/4)
ColorChooserAndroid$1 (ColorChooserAndroid): void 0%   (0/1)0%   (0/6)0%   (0/1)
onColorChanged (int): void 0%   (0/1)0%   (0/12)0%   (0/3)

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.components.web_contents_delegate_android;
6 
7import android.content.Context;
8 
9import org.chromium.base.CalledByNative;
10import org.chromium.base.JNINamespace;
11import org.chromium.content.browser.ContentViewCore;
12import org.chromium.ui.ColorPickerDialog;
13import org.chromium.ui.OnColorChangedListener;
14 
15/**
16 * ColorChooserAndroid communicates with the java ColorPickerDialog and the
17 * native color_chooser_android.cc
18 */
19@JNINamespace("web_contents_delegate_android")
20public class ColorChooserAndroid {
21    private final ColorPickerDialog mDialog;
22    private final int mNativeColorChooserAndroid;
23 
24    private ColorChooserAndroid(int nativeColorChooserAndroid,
25            Context context, int initialColor) {
26        OnColorChangedListener listener = new OnColorChangedListener() {
27          @Override
28          public void onColorChanged(int color) {
29              mDialog.dismiss();
30              nativeOnColorChosen(mNativeColorChooserAndroid, color);
31          }
32        };
33 
34        mNativeColorChooserAndroid = nativeColorChooserAndroid;
35        mDialog = new ColorPickerDialog(context, listener, initialColor);
36    }
37 
38    private void openColorChooser() {
39        mDialog.show();
40    }
41 
42    @CalledByNative
43    public void closeColorChooser() {
44        mDialog.dismiss();
45    }
46 
47    @CalledByNative
48    public static ColorChooserAndroid createColorChooserAndroid(
49            int nativeColorChooserAndroid,
50            ContentViewCore contentViewCore,
51            int initialColor) {
52        ColorChooserAndroid chooser = new ColorChooserAndroid(nativeColorChooserAndroid,
53            contentViewCore.getContext(), initialColor);
54        chooser.openColorChooser();
55        return chooser;
56    }
57 
58    // Implemented in color_chooser_android.cc
59    private native void nativeOnColorChosen(int nativeColorChooserAndroid, int color);
60}

[all classes][org.chromium.components.web_contents_delegate_android]
EMMA 2.0.5312 (C) Vladimir Roubtsov