package com.tencent.mm.plugin.webview.ui.tools.widget;

import android.app.Activity;
import android.webkit.GeolocationPermissions.Callback;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ui.base.h;
import com.tencent.mm.ui.widget.a.c;
import com.tencent.xweb.WebView;
import com.tencent.xweb.g;
import com.tencent.xweb.l;
import com.tencent.ytcommon.BuildConfig;

public class i extends l {
    private Activity czX;
    private int uwu = 0;

    public i(MMWebViewWithJsApi mMWebViewWithJsApi) {
        AppMethodBeat.i(9912);
        this.czX = (Activity) mMWebViewWithJsApi.getContext();
        AppMethodBeat.o(9912);
    }

    public void d(WebView webView, String str) {
        AppMethodBeat.i(9913);
        super.d(webView, str);
        AppMethodBeat.o(9913);
    }

    public final void onGeolocationPermissionsShowPrompt(String str, Callback callback) {
        AppMethodBeat.i(9914);
        h.a(this.czX, false, this.czX.getString(2131305707, new Object[]{str}), this.czX.getString(2131305708), this.czX.getString(2131296994), this.czX.getString(2131296868), new 1(this, callback, str), new 2(this, callback, str));
        AppMethodBeat.o(9914);
    }

    public final boolean a(WebView webView, String str, String str2, com.tencent.xweb.h hVar) {
        c a;
        AppMethodBeat.i(9915);
        this.uwu++;
        if (this.uwu > 2) {
            a = h.a(this.czX, str2, BuildConfig.FLAVOR, this.czX.getString(2131305700), this.czX.getString(2131296994), new 3(this, hVar), new 4(this, hVar), 2131690208);
        } else {
            a = h.a(this.czX, str2, BuildConfig.FLAVOR, this.czX.getString(2131296994), new 5(this, hVar));
        }
        if (a != null) {
            a.setCanceledOnTouchOutside(false);
            a.qZ(false);
            AppMethodBeat.o(9915);
            return true;
        }
        boolean a2 = super.a(webView, str, str2, hVar);
        AppMethodBeat.o(9915);
        return a2;
    }

    public final boolean b(WebView webView, String str, String str2, com.tencent.xweb.h hVar) {
        c a;
        AppMethodBeat.i(9916);
        this.uwu++;
        if (this.uwu > 2) {
            a = h.a(this.czX, str2, BuildConfig.FLAVOR, this.czX.getString(2131305700), this.czX.getString(2131296994), new 6(this, hVar), new 7(this, hVar), 2131689792);
        } else {
            a = h.a(this.czX, false, str2, BuildConfig.FLAVOR, this.czX.getString(2131296994), this.czX.getString(2131296868), new 8(this, hVar), new 9(this, hVar));
        }
        if (a != null) {
            a.setCancelable(false);
            a.setCanceledOnTouchOutside(false);
            AppMethodBeat.o(9916);
            return true;
        }
        boolean b = super.b(webView, str, str2, hVar);
        AppMethodBeat.o(9916);
        return b;
    }

    public final boolean a(WebView webView, String str, String str2, String str3, g gVar) {
        AppMethodBeat.i(9917);
        boolean a = super.a(webView, str, str2, str3, gVar);
        AppMethodBeat.o(9917);
        return a;
    }

    /* Access modifiers changed, original: protected */
    public void onClose() {
        AppMethodBeat.i(9918);
        this.czX.finish();
        AppMethodBeat.o(9918);
    }
}
