Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39335260 authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Provide variable for debugging the text in WebTextView."

parents d99a7be3 c26dc9f3
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -45,5 +45,9 @@ class DebugFlags {
    public static final boolean WEB_TEXT_VIEW = false;
    public static final boolean WEB_TEXT_VIEW = false;
    public static final boolean WEB_VIEW = false;
    public static final boolean WEB_VIEW = false;
    public static final boolean WEB_VIEW_CORE = false;
    public static final boolean WEB_VIEW_CORE = false;

    /*
     * Set to true to allow the WebTextView to draw on top of the web page in a
     * different color so that you can see how the two line up.
     */
    public static final boolean DRAW_WEBTEXTVIEW = false;
}
}
+7 −4
Original line number Original line Diff line number Diff line
@@ -157,7 +157,7 @@ import junit.framework.Assert;
        // Set the text color to black, regardless of the theme.  This ensures
        // Set the text color to black, regardless of the theme.  This ensures
        // that other applications that use embedded WebViews will properly
        // that other applications that use embedded WebViews will properly
        // display the text in password textfields.
        // display the text in password textfields.
        setTextColor(Color.BLACK);
        setTextColor(DebugFlags.DRAW_WEBTEXTVIEW ? Color.RED : Color.BLACK);
        // This helps to align the text better with the text in the web page.
        // This helps to align the text better with the text in the web page.
        setIncludeFontPadding(false);
        setIncludeFontPadding(false);
    }
    }
@@ -404,8 +404,9 @@ import junit.framework.Assert;
        // onDraw should only be called for password fields.  If WebTextView is
        // onDraw should only be called for password fields.  If WebTextView is
        // still drawing, but is no longer corresponding to a password field,
        // still drawing, but is no longer corresponding to a password field,
        // remove it.
        // remove it.
        if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword()
        if (!DebugFlags.DRAW_WEBTEXTVIEW && (mWebView == null
                || !isSameTextField(mWebView.nativeFocusCandidatePointer())) {
                || !mWebView.nativeFocusCandidateIsPassword()
                || !isSameTextField(mWebView.nativeFocusCandidatePointer()))) {
            // Although calling remove() would seem to make more sense here,
            // Although calling remove() would seem to make more sense here,
            // changing it to not be a password field will make it not draw.
            // changing it to not be a password field will make it not draw.
            // Other code will make sure that it is removed completely, but this
            // Other code will make sure that it is removed completely, but this
@@ -819,7 +820,9 @@ import junit.framework.Assert;
        }
        }
        // For password fields, draw the WebTextView.  For others, just show
        // For password fields, draw the WebTextView.  For others, just show
        // webkit's drawing.
        // webkit's drawing.
        if (!DebugFlags.DRAW_WEBTEXTVIEW) {
            setWillNotDraw(!inPassword);
            setWillNotDraw(!inPassword);
        }
        setBackgroundDrawable(inPassword ? mBackground : null);
        setBackgroundDrawable(inPassword ? mBackground : null);
    }
    }