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

Commit cdaff15b authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Create a RenderSkinButton in UI side.

Part of bug:3009375

Create a RenderSkinButton on the UI side, so that we can
use it to draw buttons and free memory, rather than depend
on globals.

Change-Id: If234ec50c42b5c9d63421ab570ea829ba56db048
parent fdcdd418
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -1043,13 +1043,16 @@ class BrowserFrame extends Handler {
    // These ids need to be in sync with enum rawResId in PlatformBridge.h
    private static final int NODOMAIN = 1;
    private static final int LOADERROR = 2;
    private static final int DRAWABLEDIR = 3;
    /* package */ static final int DRAWABLEDIR = 3;
    private static final int FILE_UPLOAD_LABEL = 4;
    private static final int RESET_LABEL = 5;
    private static final int SUBMIT_LABEL = 6;
    private static final int FILE_UPLOAD_NO_FILE_CHOSEN = 7;

    String getRawResFilename(int id) {
    private String getRawResFilename(int id) {
        return getRawResFilename(id, mContext);
    }
    /* package */ static String getRawResFilename(int id, Context context) {
        int resid;
        switch (id) {
            case NODOMAIN:
@@ -1066,19 +1069,19 @@ class BrowserFrame extends Handler {
                break;

            case FILE_UPLOAD_LABEL:
                return mContext.getResources().getString(
                return context.getResources().getString(
                        com.android.internal.R.string.upload_file);

            case RESET_LABEL:
                return mContext.getResources().getString(
                return context.getResources().getString(
                        com.android.internal.R.string.reset);

            case SUBMIT_LABEL:
                return mContext.getResources().getString(
                return context.getResources().getString(
                        com.android.internal.R.string.submit);

            case FILE_UPLOAD_NO_FILE_CHOSEN:
                return mContext.getResources().getString(
                return context.getResources().getString(
                        com.android.internal.R.string.no_file_chosen);

            default:
@@ -1086,7 +1089,7 @@ class BrowserFrame extends Handler {
                return "";
        }
        TypedValue value = new TypedValue();
        mContext.getResources().getValue(resid, value, true);
        context.getResources().getValue(resid, value, true);
        if (id == DRAWABLEDIR) {
            String path = value.string.toString();
            int index = path.lastIndexOf('/');
+6 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.database.DataSetObserver;
import android.graphics.Bitmap;
@@ -7328,7 +7329,10 @@ public class WebView extends AbsoluteLayout
                }
                case WEBCORE_INITIALIZED_MSG_ID:
                    // nativeCreate sets mNativeClass to a non-zero value
                    nativeCreate(msg.arg1);
                    String drawableDir = BrowserFrame.getRawResFilename(
                            BrowserFrame.DRAWABLEDIR, mContext);
                    AssetManager am = mContext.getAssets();
                    nativeCreate(msg.arg1, drawableDir, am);
                    break;
                case UPDATE_TEXTFIELD_TEXT_MSG_ID:
                    // Make sure that the textfield is currently focused
@@ -8294,7 +8298,7 @@ public class WebView extends AbsoluteLayout
    private native Rect nativeCacheHitNodeBounds();
    private native int nativeCacheHitNodePointer();
    /* package */ native void nativeClearCursor();
    private native void     nativeCreate(int ptr);
    private native void     nativeCreate(int ptr, String drawableDir, AssetManager am);
    private native int      nativeCursorFramePointer();
    private native Rect     nativeCursorNodeBounds();
    private native int nativeCursorNodePointer();