QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 QBWebviewWrapper.java 源代码,内容仅作参考
package com.tencent.mtt.browser.window.templayer;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Picture;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.ValueCallback;
import android.widget.FrameLayout;
import com.tencent.common.boot.BootChainEvent;
import com.tencent.common.boot.BootTracer;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.http.IPostDataBuf;
import com.tencent.common.manifest.AppManifest;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.StringUtils;
import com.tencent.common.utils.UrlUtils;
import com.tencent.luggage.wxa.gq.a;
import com.tencent.midas.data.APMidasPluginInfo;
import com.tencent.mtt.R;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.skin.InstalledSkin;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.PCGStatManager;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.utils.QBUrlUtils;
import com.tencent.mtt.base.webview.QBNewJsDialogFactory;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.base.webview.WebExtension;
import com.tencent.mtt.base.webview.WebViewUtils;
import com.tencent.mtt.base.webview.common.FindListener;
import com.tencent.mtt.base.webview.common.IWebBackForwardList;
import com.tencent.mtt.base.webview.common.IWebHistoryItem;
import com.tencent.mtt.base.webview.common.QBWebSettings;
import com.tencent.mtt.base.webview.common.QBWebViewClient;
import com.tencent.mtt.base.webview.common.WebViewTransport;
import com.tencent.mtt.base.webview.extension.IWebViewPullDown;
import com.tencent.mtt.base.webview.extension.IWebviewHeaderExtension;
import com.tencent.mtt.base.webview.extension.IskinSwitchListener;
import com.tencent.mtt.base.webview.extension.QBWebViewBackOrForwardChangeListener;
import com.tencent.mtt.base.webview.extension.QBWebViewOnHistoryItemChangedListener;
import com.tencent.mtt.base.webview.preload.CommonPreloadWebviewService;
import com.tencent.mtt.base.webview.preload.CommonQbWebview;
import com.tencent.mtt.base.wrapper.callback.IScrollListener;
import com.tencent.mtt.base.wrapper.callback.WebViewScrollChangeListener;
import com.tencent.mtt.base.wrapper.extension.IQQBrowserSettings;
import com.tencent.mtt.base.wrapper.extension.IWebSettingsExtension;
import com.tencent.mtt.browser.StatusBarColorManager;
import com.tencent.mtt.browser.WebEngine;
import com.tencent.mtt.browser.bra.addressbar.AddressBarController;
import com.tencent.mtt.browser.bra.addressbar.AddressBarDataSource;
import com.tencent.mtt.browser.bra.addressbar.IAddressBarControllerProxy;
import com.tencent.mtt.browser.bra.toolbar.ToolBar;
import com.tencent.mtt.browser.file.facade.IFileStatService;
import com.tencent.mtt.browser.lite.FontSizeUtils;
import com.tencent.mtt.browser.pagescroller.PageScrollerBackgroundDrawable;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.browser.setting.manager.UserSettingManager;
import com.tencent.mtt.browser.stat.WebViewStatDataStore;
import com.tencent.mtt.browser.window.BrowserUIParams;
import com.tencent.mtt.browser.window.FullScreenManager;
import com.tencent.mtt.browser.window.GestureMovePageManager;
import com.tencent.mtt.browser.window.IPage;
import com.tencent.mtt.browser.window.IPageWebview;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.IWebViewClient;
import com.tencent.mtt.browser.window.PageFrame;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.WindowManager;
import com.tencent.mtt.browser.window.data.PageInfo;
import com.tencent.mtt.browser.window.monitor.H5PerformanceTimingManager;
import com.tencent.mtt.browser.window.templayer.WebviewBackReportHelper;
import com.tencent.mtt.browser.window.templayer.singepage.SingleWebHelper;
import com.tencent.mtt.browser.x5.drawable.X5LogoDrawable;
import com.tencent.mtt.browser.x5.drawable.X5ReleaseableDrawable;
import com.tencent.mtt.browser.x5.drawable.X5WebViewSnapshotWithAddressBarDrawble;
import com.tencent.mtt.external.comic.facade.IComicService;
import com.tencent.mtt.search.view.common.skin.SearchResultSkinManager;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.video.export.H5VideoTime;
import com.tencent.mtt.video.export.VideoProxyDefault;
import com.tencent.mtt.view.layout.QBFrameLayout;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.mtt.view.viewpager.QBTabHostAdapter;
import com.tencent.mtt.view.viewpager.QBViewPager;
import com.tencent.rmpbusiness.report.TraceEvent;
import com.tencent.rmpbusiness.report.TraceEventCallback;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Vector;
import qb.a.e;
import qb.a.g;
import qb.framework.BuildConfig;
public class QBWebviewWrapper implements IScrollListener, WebEngine.WebCoreStateObserver, IAddressBarControllerProxy, IPageWebview {
private static PaintFlagsDrawFilter f46538c = new PaintFlagsDrawFilter(134, 64);
private AddressBarDataSource A;
private Handler B;
private AnimUnlockRunable C;
private UrlParams D;
private Bundle E;
private int F;
private int G;
private StatusBarColorManager H;
private Bitmap I;
private boolean J;
private boolean K;
private boolean L;
private Drawable M;
private boolean N;
private Drawable O;
private int P;
private int Q;
private int R;
private int S;
private int T;
private final boolean U;
private int V;
private LinkedList<WebviewBackReportHelper.BackKeyClickInfo> W;
private int X;
private boolean Y;
private SingleWebHelper Z;
JsCallback f46539a;
private IWebView.STATUS_BAR aa;
public Object f46540b;
private IWebViewClient f46541d;
private WrapperViewPager e;
private QBTabHostAdapter f;
private ArrayList g;
private QBFrameLayout h;
private QBFrameLayout i;
private QBWebView j;
private String k;
private boolean l;
private IPostDataBuf m;
private Bundle n;
private boolean o;
private boolean p;
private int q;
private boolean r;
private boolean s;
private boolean t;
private QBWebViewClient u;
private DefaultX5BrowserClient v;
private boolean w;
private IskinSwitchListener x;
private HashMap<String, String> y;
private String z;
public class AnimUnlockRunable implements Runnable {
private AnimUnlockRunable() {
}
@Override
public void run() {
QBWebviewWrapper.this.B.post(new Runnable() {
@Override
public void run() {
QBWebviewWrapper.this.w = true;
QBWebviewWrapper.this.j.setForeground(null);
if (QBWebviewWrapper.this.M != null) {
QBWebviewWrapper.this.M.setCallback(null);
}
QBWebviewWrapper.this.M = null;
QBWebviewWrapper.this.j.invalidate();
QBWebviewWrapper.this.e.invalidate();
DrawableReleaseTask.b();
if (QBWebviewWrapper.this.f46541d != null) {
QBWebviewWrapper.this.f46541d.onBackForwardAnimationFinished(QBWebviewWrapper.this, QBWebviewWrapper.this);
}
}
});
}
}
public static class DrawableReleaseTask implements Runnable {
private static ArrayList<DrawableReleaseTask> f46560c = new ArrayList<>();
private Drawable f46561a;
private QBWebView f46562b;
public DrawableReleaseTask(QBWebView qBWebView, Drawable drawable) {
this.f46561a = drawable;
this.f46562b = qBWebView;
}
public static void a(DrawableReleaseTask drawableReleaseTask) {
f46560c.add(drawableReleaseTask);
}
public static void b() {
ArrayList arrayList = new ArrayList(f46560c);
ArrayList arrayList2 = new ArrayList();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
DrawableReleaseTask drawableReleaseTask = (DrawableReleaseTask) it.next();
Drawable a2 = drawableReleaseTask.a();
if (a2 != null && a2.getCallback() == null) {
drawableReleaseTask.run();
arrayList2.add(drawableReleaseTask);
}
}
f46560c.removeAll(arrayList2);
}
public Drawable a() {
return this.f46561a;
}
@Override
public void run() {
Drawable drawable = this.f46561a;
if (drawable != null) {
this.f46562b.releaseDrawable(drawable);
this.f46561a = null;
}
}
}
public class WrapperViewPager extends QBViewPager {
public WrapperViewPager(Context context) {
super(context);
}
public QBWebView getWebView() {
return QBWebviewWrapper.this.j;
}
}
public QBWebviewWrapper(Context context, IWebViewClient iWebViewClient) {
this(context, iWebViewClient, false, null);
}
public QBWebviewWrapper(Context context, IWebViewClient iWebViewClient, boolean z, UrlParams urlParams) {
this.g = new ArrayList();
this.l = false;
this.o = false;
this.q = 0;
this.r = false;
this.s = false;
this.t = false;
this.w = true;
this.A = new AddressBarDataSource();
this.C = new AnimUnlockRunable();
this.D = null;
this.F = 0;
this.G = 0;
this.H = null;
this.J = false;
this.K = false;
this.L = false;
this.M = null;
this.N = false;
this.O = null;
this.P = -1;
this.Q = 0;
this.R = 0;
this.S = 0;
this.T = 0;
this.V = 0;
this.W = new LinkedList<>();
this.X = 0;
this.Y = false;
this.aa = IWebView.STATUS_BAR.DEFAULT;
BootTracer.b(urlParams == null ? "" : urlParams.f46351a, "QBWebviewWrapper");
g(APMidasPluginInfo.LAUNCH_INTERFACE_INIT);
this.U = z;
this.A.a(this);
this.B = new Handler(Looper.getMainLooper());
setWebViewClient(iWebViewClient);
this.F = BaseSettings.a().n();
ActivityHandler.b().a();
this.H = StatusBarColorManager.getInstance();
this.N = context.getResources().getConfiguration().orientation == 2;
this.V = Integer.valueOf(PublicSettingManager.a().getString("ANDROID_PUBLIC_PREFS_WEB_BACKKEY_CLICK_LIMIT_TIME", "0")).intValue();
this.X = Integer.valueOf(PublicSettingManager.a().getString("ANDROID_PUBLIC_PREFS_WEB_BACKKEY_CLICK_LIMIT_COUNT", "0")).intValue();
B();
this.j = a(context, urlParams);
this.j.setNormalEnv(true);
if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_868075379)) {
this.j.initCenterLoading();
}
this.e = a(context);
this.e.setOnPageChangeListener(A());
this.f = z();
y();
this.e.setAdapter(this.f);
WrapperViewPager wrapperViewPager = this.e;
wrapperViewPager.setPageTransformer(false, new BasicWindowTransformer(wrapperViewPager));
this.e.setFlingLikeGallery(true);
this.e.setFlingDuration(350);
b(context);
PCGStatManager.a(this.e, "130");
this.e.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
PCGStatManager.a((View) QBWebviewWrapper.this.e);
}
@Override
public void onViewDetachedFromWindow(View view) {
}
});
if (this.j != null) {
Bundle bundle = new Bundle();
if (urlParams != null) {
bundle.putInt(IFileStatService.EVENT_REPORT_FROM_WHERE, urlParams.f);
}
WebViewStatDataStore.getInstance().put(this.j, bundle);
}
this.Z = new SingleWebHelper(this);
}
private QBViewPager.OnPageChangeListener A() {
return new QBViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int i, int i2) {
QBWebviewWrapper.this.p = i2 != 0;
if (i2 == 0) {
int currentItem = QBWebviewWrapper.this.e.getCurrentItem();
if (i2 + i != 0) {
QBWebviewWrapper.this.O = null;
}
if (i != 0) {
if (QBWebviewWrapper.this.q != 0) {
QBWebviewWrapper.this.C();
} else {
QBWebviewWrapper.this.L();
}
QBWebviewWrapper.this.e(currentItem);
if (currentItem == 1) {
DrawableReleaseTask.b();
if (QBWebviewWrapper.this.f46541d != null) {
IWebViewClient iWebViewClient = QBWebviewWrapper.this.f46541d;
QBWebviewWrapper qBWebviewWrapper = QBWebviewWrapper.this;
iWebViewClient.onBackForwardAnimationFinished(qBWebviewWrapper, qBWebviewWrapper);
}
}
}
}
}
@Override
public void onPageScrolled(int i, float f, int i2) {
}
@Override
public void onPageSelected(int i) {
int goBackOrForwardToDesiredSteps;
if (i > 1) {
QBWebviewWrapper.this.w = false;
QBWebviewWrapper.this.B.postDelayed(QBWebviewWrapper.this.C, 4000L);
goBackOrForwardToDesiredSteps = QBWebviewWrapper.this.j.getGoBackOrForwardToDesiredSteps(1);
} else {
if (i >= 1) {
return;
}
QBWebviewWrapper.this.w = false;
QBWebviewWrapper.this.B.postDelayed(QBWebviewWrapper.this.C, 4000L);
goBackOrForwardToDesiredSteps = QBWebviewWrapper.this.j.getGoBackOrForwardToDesiredSteps(-1);
}
QBWebviewWrapper.this.q += goBackOrForwardToDesiredSteps;
}
};
}
private void B() {
Bitmap bitmap;
if (!SkinManager.s().f() || SearchResultSkinManager.a().b()) {
bitmap = null;
} else {
this.I = MttResources.p(InstalledSkin.f32920c);
if (this.I == null) {
return;
}
float height = r0.getHeight() / DeviceUtils.ac();
Matrix matrix = new Matrix();
matrix.setScale(DeviceUtils.af() / this.I.getWidth(), 1.0f / height);
Bitmap bitmap2 = this.I;
bitmap = Bitmap.createBitmap(bitmap2, 0, 0, bitmap2.getWidth(), ((int) (BaseSettings.a().m() * height)) + 1, matrix, false);
}
this.I = bitmap;
}
public void C() {
int i;
QBWebView qBWebView;
int i2;
QBFrameLayout qBFrameLayout;
QBWebView qBWebView2 = this.j;
if (qBWebView2 == null || (i = this.q) == 0) {
return;
}
if (!(i == 1 ? qBWebView2.canGoForward() : i == -1 ? qBWebView2.canGoBack() : qBWebView2.canGoBackOrForward(i))) {
IWebBackForwardList copyQBBackForwardList = this.j.copyQBBackForwardList();
if (copyQBBackForwardList != null) {
int b2 = copyQBBackForwardList.b();
if (this.q <= 0) {
qBWebView = this.j;
i2 = -b2;
} else {
this.j.goBackOrForward((copyQBBackForwardList.c() - 1) - b2);
}
}
this.q = 0;
}
int i3 = this.q;
if (i3 >= 0 ? !(i3 <= 0 || (qBFrameLayout = this.i) == null) : (qBFrameLayout = this.h) != null) {
this.M = qBFrameLayout.getBackground();
}
qBWebView = this.j;
i2 = this.q;
qBWebView.goBackOrForward(i2);
this.q = 0;
}
public void D() {
this.h.removeAllViews();
this.h.setBackgroundColor(SkinManager.s().l() ? -16777216 : -1);
this.i.removeAllViews();
this.i.setBackgroundColor(SkinManager.s().l() ? -16777216 : -1);
}
private QBWebView E() {
if (this.o) {
return this.j;
}
return null;
}
public void F() {
if (this.o) {
return;
}
this.o = true;
U();
this.j.init();
this.j.setPlatformFlag(QBWebView.WEB_PLATFORM.NORMAL);
M();
K();
u();
Bundle bundle = this.E;
if (bundle != null) {
this.j.setSkvDataForSearchTeam(bundle.getString("key_search_direct_extra_info"));
} else {
this.j.setSkvDataForSearchTeam("");
}
if (this.s) {
P();
this.j.requestWebViewFocus();
}
}
private WebViewScrollChangeListener G() {
return new WebViewScrollChangeListener() {
@Override
public void onScrollChange(int i, int i2, int i3, int i4) {
QBWebviewWrapper.this.getAddressBarDataSource().f35822c = i4;
QBWebviewWrapper.this.Z.a(i, i2, i3, i4);
}
};
}
private QBWebViewBackOrForwardChangeListener H() {
return new QBWebViewBackOrForwardChangeListener() {
@Override
public void onBackOrForwardChanged(QBWebView qBWebView) {
QBWebviewWrapper.this.L();
if (QBWebviewWrapper.this.f46541d != null) {
if (QBWebviewWrapper.this.j.canGoBack() || QBWebviewWrapper.this.j.canGoForward()) {
IWebViewClient iWebViewClient = QBWebviewWrapper.this.f46541d;
QBWebviewWrapper qBWebviewWrapper = QBWebviewWrapper.this;
iWebViewClient.onBackOrForwardChanged(qBWebviewWrapper, qBWebviewWrapper);
} else {
IWebViewClient iWebViewClient2 = QBWebviewWrapper.this.f46541d;
QBWebviewWrapper qBWebviewWrapper2 = QBWebviewWrapper.this;
iWebViewClient2.onBottomStackChanged(qBWebviewWrapper2, qBWebviewWrapper2);
}
}
}
};
}
private QBWebViewOnHistoryItemChangedListener I() {
return new QBWebViewOnHistoryItemChangedListener() {
int f46548a;
@Override
public void a(IWebHistoryItem iWebHistoryItem) {
if (QBWebviewWrapper.this.f46541d != null) {
QBWebviewWrapper.this.f46541d.onNewHistroyItem(QBWebviewWrapper.this.getQBWebView(), iWebHistoryItem.a(), iWebHistoryItem.c(), iWebHistoryItem.b());
}
}
@Override
public void b(IWebHistoryItem iWebHistoryItem) {
if (this.f46548a != iWebHistoryItem.a()) {
QBWebviewWrapper.this.getAddressBarDataSource().d();
}
this.f46548a = iWebHistoryItem.a();
if (QBWebviewWrapper.this.f46541d != null) {
QBWebviewWrapper.this.f46541d.onHistroyItemChanged(QBWebviewWrapper.this.getQBWebView(), iWebHistoryItem.a(), iWebHistoryItem.c(), iWebHistoryItem.b());
}
}
@Override
public void c(IWebHistoryItem iWebHistoryItem) {
if (QBWebviewWrapper.this.f46541d != null) {
QBWebviewWrapper.this.f46541d.onHistroyItemRemove(iWebHistoryItem.a(), iWebHistoryItem.c(), iWebHistoryItem.b());
}
}
};
}
private DefaultChromeClientExtension J() {
return new DefaultChromeClientExtension(this) {
@Override
public void a(int i) {
super.a(i);
QBWebviewWrapper.this.C.run();
QBWebviewWrapper.this.B.removeCallbacks(QBWebviewWrapper.this.C);
}
@Override
public boolean b(int i) {
if (i == -1) {
if (QBWebviewWrapper.this.j != null && !QBWebviewWrapper.this.j.canGoBack() && (QBWebviewWrapper.this.f46541d instanceof NewPageFrame)) {
((NewPageFrame) QBWebviewWrapper.this.f46541d).back(false);
return false;
}
} else if (i == 1 && QBWebviewWrapper.this.j != null && !QBWebviewWrapper.this.j.canGoForward() && (QBWebviewWrapper.this.f46541d instanceof NewPageFrame)) {
((NewPageFrame) QBWebviewWrapper.this.f46541d).forward();
return false;
}
return super.b(i);
}
};
}
private void K() {
IQQBrowserSettings.ImageQuality imageQuality;
this.j.getQBSettings().q(false);
this.j.getQBSettings().p(false);
this.j.getQBSettings().a(true);
this.j.getQBSettings().c(true);
QBWebView qBWebView = getQBWebView();
if (qBWebView != null) {
int i = PublicSettingManager.a().getInt("key_protect_eye_color", -1);
qBWebView.setEyeShieldMode(i != -1, i);
X5LogoDrawable x5LogoDrawable = new X5LogoDrawable(this.j, true, true);
if (getAddressBarDataSource() == null || !getAddressBarDataSource().g) {
x5LogoDrawable.a(false);
} else {
x5LogoDrawable.a(true);
}
qBWebView.setOverScrollParams(QBWebView.OVER_SCROLL_NEVER, 0, 0, QBWebView.OVER_SCROLL_ALWAYS, 1073741823, 0, null, x5LogoDrawable, new X5LogoDrawable(this.j, false, true));
IWebSettingsExtension qBSettingsExtension = this.j.getQBSettingsExtension();
if (qBSettingsExtension != null) {
qBSettingsExtension.d(!PublicSettingManager.a().e());
qBSettingsExtension.b(UserSettingManager.b().c());
qBSettingsExtension.f(UserSettingManager.b().getBoolean("Key4FitScreen", false));
qBSettingsExtension.c(!SkinManager.s().l());
qBSettingsExtension.a(false);
qBSettingsExtension.i(true);
qBSettingsExtension.j(false);
qBSettingsExtension.n(true);
qBSettingsExtension.k(true);
try {
qBSettingsExtension.g(PublicSettingManager.a().getBoolean("key_show_translate_web_page", true));
qBSettingsExtension.l(PublicSettingManager.a().getBoolean("key_show_voice_read", true));
} catch (Throwable unused) {
}
}
IQQBrowserSettings qQBrowserSettings = qBWebView.getQQBrowserSettings();
qQBrowserSettings.a(UserSettingManager.b().getBoolean("mKey4EnableX5Proxy", true));
int i2 = UserSettingManager.b().getInt("KeyImageQualityOption", 1);
if (i2 == 0) {
imageQuality = IQQBrowserSettings.ImageQuality.LOW;
} else {
if (i2 != 1) {
if (i2 == 2) {
imageQuality = IQQBrowserSettings.ImageQuality.HIGH;
}
this.j.getQBSettings().l(true);
qQBrowserSettings.b(UserSettingManager.b().l());
qQBrowserSettings.a("normal");
Bundle bundle = new Bundle();
bundle.putBoolean("enable", true);
this.j.invokeMiscMethod("setFloatVideoEnabled", bundle);
this.j.setDownloadListener(new QBDownloadListener(this));
}
imageQuality = IQQBrowserSettings.ImageQuality.MEDIUM;
}
qQBrowserSettings.a(imageQuality);
this.j.getQBSettings().l(true);
qQBrowserSettings.b(UserSettingManager.b().l());
qQBrowserSettings.a("normal");
Bundle bundle2 = new Bundle();
bundle2.putBoolean("enable", true);
this.j.invokeMiscMethod("setFloatVideoEnabled", bundle2);
this.j.setDownloadListener(new QBDownloadListener(this));
}
}
public void L() {
if (this.e.getCurrentItem() != 1) {
this.e.setCurrentItem(1, false);
}
if (this.s) {
this.j.requestWebViewFocus();
}
}
private void M() {
WebExtension webExtension = (WebExtension) AppManifest.getInstance().queryExtension(WebExtension.class, null);
if (webExtension != null) {
webExtension.onQBWebViewInitInFramework();
this.u = webExtension.createWebViewClient(this.j, this.f46541d, this);
this.j.setQBWebViewClient(this.u);
this.j.setWebViewClientExtension(webExtension.createDefaultWebViewClientExtension(this.j, this, this.u, this.f46541d));
}
this.j.setQBWebChromeClient(new DefaultWebChromeClient(this));
this.j.setBackOrForwardChangeListener(H());
this.v = new DefaultX5BrowserClient(this, this.j, this.f46541d, this.u);
this.j.setQQBrowserClient(this.v);
this.j.setWebChromeClientExtension(J());
this.j.setX5WebViewOnScrollListener(this);
this.j.setOnWebViewScrollChangeListener(G());
this.j.setQBWebViewOnHistoryItemChangedListener(I());
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
iWebViewClient.getBussinessProxy().a(this.j);
}
if (this.U) {
this.j.setAddressbarDisplayMode(2, false, true);
}
}
private void N() {
if (this.X == 0 || this.V == 0) {
return;
}
if (this.W.size() < this.X) {
this.W.offer(new WebviewBackReportHelper.BackKeyClickInfo(System.currentTimeMillis(), getUrl(), O()));
return;
}
WebviewBackReportHelper.BackKeyClickInfo poll = this.W.poll();
if (poll != null) {
long currentTimeMillis = System.currentTimeMillis();
long a2 = poll.a();
String url = getUrl();
String b2 = poll.b();
int O = O();
int c2 = poll.c();
if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(b2)) {
a(currentTimeMillis, a2, url, b2, O, c2);
}
this.W.offer(new WebviewBackReportHelper.BackKeyClickInfo(currentTimeMillis, url, O));
}
}
private int O() {
Object invokeMiscMethod;
QBWebView qBWebView = this.j;
if (qBWebView == null || (invokeMiscMethod = qBWebView.invokeMiscMethod("fastGetCurrentEntryIndex", new Bundle())) == null || !(invokeMiscMethod instanceof Bundle)) {
return 0;
}
return ((Bundle) invokeMiscMethod).getInt(IComicService.SCROLL_TO_PAGE_INDEX);
}
private void P() {
this.j.active();
ToolBar q = AddressBarController.a().q();
if (q != null) {
q.a(this.j, false);
}
StatusBarColorManager.getInstance().a(this);
r();
JsCallback jsCallback = this.f46539a;
if (jsCallback != null) {
jsCallback.a(true);
}
this.O = null;
refreshSkin();
this.e.invalidate();
}
private void Q() {
R();
this.e.invalidate();
}
private void R() {
Activity a2;
this.aa = IWebView.STATUS_BAR.DEFAULT;
if (SearchResultSkinManager.a().b()) {
this.aa = SkinManager.s().l() ? IWebView.STATUS_BAR.STATSU_LIGH : IWebView.STATUS_BAR.STATUS_DARK;
}
if (!this.s || (a2 = ActivityHandler.b().a()) == null) {
return;
}
this.H.a(a2.getWindow(), this.aa);
}
private boolean S() {
int e = FullScreenManager.a().e(null);
return (e & 256) == 0 && (e & 16) != 0;
}
public boolean T() {
return !DeviceUtils.aq() || DeviceUtils.b(ActivityHandler.b().a().getWindow()) || DeviceUtils.a();
}
private boolean U() {
return Looper.myLooper() == Looper.getMainLooper();
}
private QBWebView a(Context context, UrlParams urlParams) {
if (urlParams != null && (urlParams.i instanceof CommonPreloadWebviewService)) {
CommonPreloadWebviewService commonPreloadWebviewService = (CommonPreloadWebviewService) urlParams.i;
if (!commonPreloadWebviewService.c() && commonPreloadWebviewService.b()) {
QBWebView a2 = commonPreloadWebviewService.a();
commonPreloadWebviewService.a(this.e);
this.Y = true;
return a2;
}
commonPreloadWebviewService.d();
}
return new CommonQbWebview(context, true, null, 0, null, false, BrowserUIParams.e(), BrowserUIParams.f(), this.U ? 1 : 2) {
@Override
public void draw(Canvas canvas) {
canvas.save();
if (getPaddingBottom() > 0) {
canvas.clipRect(0, 0, getMeasuredWidth(), getMeasuredHeight() - getPaddingBottom());
}
super.draw(canvas);
canvas.restore();
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
if (!QBWebviewWrapper.this.e.isIdle() || motionEvent.getY() <= getHeight() - getPaddingBottom()) {
return super.onTouchEvent(motionEvent);
}
KeyEvent.Callback maskView = getMaskView();
if (maskView == null || !(maskView instanceof IWebViewPullDown)) {
return false;
}
return ((IWebViewPullDown) maskView).b(motionEvent);
}
@Override
public void setBackgroundColor(int i) {
super.setBackgroundColor(i);
}
@Override
public void setPadding(int i, int i2, int i3, int i4) {
super.setPadding(i, i2, i3, i4);
}
@Override
public void systemOverScrollBy(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, boolean z) {
a(i, i2, i3, i4, i5, i6, i7, i8, z);
}
};
}
private WrapperViewPager a(Context context) {
return new WrapperViewPager(context) {
private Canvas an;
private PageMaskHelper ao = new PageMaskHelper();
private void a(Canvas canvas) {
Bitmap bitmap;
if (QBWebviewWrapper.this.M != null) {
if ((QBWebviewWrapper.this.M instanceof BitmapDrawable) && ((bitmap = ((BitmapDrawable) QBWebviewWrapper.this.M).getBitmap()) == null || bitmap.isRecycled())) {
return;
}
canvas.save();
if (QBWebviewWrapper.this.M instanceof X5ReleaseableDrawable) {
canvas.translate(0.0f, (QBWebviewWrapper.this.N || QBWebviewWrapper.this.T()) ? 0.0f : QBWebviewWrapper.this.F);
}
if (QBWebviewWrapper.this.M instanceof X5WebViewSnapshotWithAddressBarDrawble) {
canvas.translate(QBWebviewWrapper.this.j.getPaddingLeft(), 0.0f);
}
QBWebviewWrapper.this.M.draw(canvas);
canvas.restore();
}
}
private boolean c(View view) {
return !(view instanceof QBWebView);
}
@Override
protected boolean checkStartDrag(float f, float f2, float f3, float f4, boolean z, boolean z2) {
if (f < f2) {
return false;
}
if (this.checkTouchSlop) {
return (z || f <= ((float) (this.mTouchSlop * 2)) || f3 <= ((float) (getWidth() / 2))) && f > ((float) (this.mTouchSlop * 2));
}
return true;
}
@Override
protected void dispatchDraw(Canvas canvas) {
this.an = canvas;
super.dispatchDraw(canvas);
this.an = null;
this.ao.a(this, canvas);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
int save = canvas.save();
if (QBWebviewWrapper.this.J || QBWebviewWrapper.this.L) {
if (QBWebviewWrapper.this.K || !QBWebviewWrapper.this.L) {
canvas.translate(getScrollX(), 0.0f);
} else {
int scrollX = (int) (getScrollX() * 0.65d);
canvas.translate(scrollX, 0.0f);
canvas.clipRect(0, 0, getMeasuredWidth() - scrollX, QBWebviewWrapper.this.F);
}
}
a(canvas);
if (QBWebviewWrapper.this.R > 0) {
Bitmap bitmap = QBWebviewWrapper.this.I;
canvas.save();
if (bitmap != null) {
canvas.drawBitmap(QBWebviewWrapper.this.I, 0.0f, 0.0f, (Paint) null);
} else {
canvas.clipRect(0, 0, getMeasuredWidth(), QBWebviewWrapper.this.R);
canvas.drawColor(QBWebviewWrapper.this.G);
}
canvas.restore();
}
canvas.restoreToCount(save);
if (QBWebviewWrapper.this.O != null) {
QBWebviewWrapper.this.O.draw(canvas);
}
}
@Override
public int getChildDrawingOrder(int i, int i2) {
Canvas canvas;
int childDrawingOrder = super.getChildDrawingOrder(i, i2);
View childAt = getChildAt(childDrawingOrder);
if (QBWebviewWrapper.this.p && (childAt.getVisibility() == 0 || childAt.getAnimation() != null)) {
int scrollX = getScrollX();
int left = childAt.getLeft();
if (left >= scrollX - childAt.getWidth() && left <= scrollX + getWidth() && (canvas = this.an) != null) {
int save = canvas.save();
this.an.translate(left + childAt.getTranslationX(), 0.0f);
this.an.clipRect(0, 0, childAt.getWidth(), childAt.getHeight() - childAt.getPaddingBottom());
if (c(childAt)) {
WindowManager.a().x().getBrowserBussinessProxy().a(this.an);
}
this.an.restoreToCount(save);
}
}
return childDrawingOrder;
}
@Override
public boolean isGutterDrag(float f, float f2) {
return false;
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
ToolBar q = AddressBarController.a().q();
if (q != null) {
q.setTranslationY(0.0f);
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
QBWebviewWrapper.this.N = configuration.orientation == 2;
}
@Override
public boolean onStartDrag(boolean z) {
String str;
PagePlaceHolder pagePlaceHolder;
boolean z2;
IWebViewClient iWebViewClient;
QBWebviewWrapper qBWebviewWrapper;
IWebView iWebView;
PagePlaceHolder pagePlaceHolder2;
if (QBWebviewWrapper.this.j.isPullDown() || !QBWebviewWrapper.this.s || !QBWebviewWrapper.this.w || this.mScrollState != 0 || !((NewPageFrame) QBWebviewWrapper.this.f46541d).isIdle() || !GestureMovePageManager.a().b()) {
return false;
}
QBWebviewWrapper.this.j(z);
if (QBWebviewWrapper.this.e.getCurrentItem() != 1) {
return false;
}
if (z && !((PageFrame) QBWebviewWrapper.this.f46541d).canGoForward()) {
return false;
}
if (!z && !((PageFrame) QBWebviewWrapper.this.f46541d).canGoBack(false)) {
return false;
}
QBWebviewWrapper.this.D();
int goBackOrForwardToDesiredSteps = QBWebviewWrapper.this.j.getGoBackOrForwardToDesiredSteps(-1);
int goBackOrForwardToDesiredSteps2 = QBWebviewWrapper.this.j.getGoBackOrForwardToDesiredSteps(1);
IWebView nextWebView = ((NewPageFrame) QBWebviewWrapper.this.f46541d).getNextWebView();
IWebHistoryItem qBHistoryItem = QBWebviewWrapper.this.j.getQBHistoryItem(z ? goBackOrForwardToDesiredSteps2 : goBackOrForwardToDesiredSteps);
PagePlaceHolder pagePlaceHolder3 = null;
String b2 = qBHistoryItem != null ? qBHistoryItem.b() : null;
boolean canGoBack = QBWebviewWrapper.this.canGoBack();
boolean canGoForward = QBWebviewWrapper.this.canGoForward();
if (canGoBack && canGoForward) {
Drawable[] snapshotForBackForward = QBWebviewWrapper.this.j.snapshotForBackForward(new int[]{goBackOrForwardToDesiredSteps, goBackOrForwardToDesiredSteps2}, true, new boolean[]{QBWebviewWrapper.this.g(goBackOrForwardToDesiredSteps), QBWebviewWrapper.this.g(goBackOrForwardToDesiredSteps2)});
if (snapshotForBackForward == null || snapshotForBackForward[0] == null || snapshotForBackForward[1] == null) {
return false;
}
QBWebviewWrapper.this.a(snapshotForBackForward[0], snapshotForBackForward[1]);
str = b2;
pagePlaceHolder2 = null;
} else {
if (!canGoBack || canGoForward) {
if (canGoBack || !canGoForward) {
str = b2;
pagePlaceHolder = null;
z2 = false;
} else {
Drawable[] snapshotForBackForward2 = QBWebviewWrapper.this.j.snapshotForBackForward(new int[]{goBackOrForwardToDesiredSteps2}, true, new boolean[]{QBWebviewWrapper.this.g(goBackOrForwardToDesiredSteps2)});
if (snapshotForBackForward2 == null || snapshotForBackForward2[0] == null) {
return false;
}
QBWebviewWrapper.this.a((Drawable) null, snapshotForBackForward2[0]);
View parentAnimationView = ((NewPageFrame) QBWebviewWrapper.this.f46541d).getParentAnimationView(-1);
if (parentAnimationView != 0 && parentAnimationView.getParent() != QBWebviewWrapper.this.h) {
QBWebviewWrapper.this.h.addView(parentAnimationView);
if (QBWebviewWrapper.this.f46541d != null && QBWebviewWrapper.this.f46541d.getBussinessProxy().a(parentAnimationView)) {
QBWebviewWrapper.this.a(new PageScrollerBackgroundDrawable(WindowManager.a().x()), (Drawable) null);
}
}
if (!z && (parentAnimationView instanceof IWebView)) {
b2 = ((IWebView) parentAnimationView).getUrl();
}
if (parentAnimationView == 0) {
QBWebviewWrapper.this.e.setFirstOffsetBy(QBWebviewWrapper.this.j);
}
str = b2;
z2 = true;
pagePlaceHolder3 = parentAnimationView;
pagePlaceHolder = null;
}
if (QBWebviewWrapper.this.f46541d != null && z2) {
if (z) {
pagePlaceHolder3 = pagePlaceHolder;
}
if (str == null && (pagePlaceHolder3 instanceof IWebView)) {
str = pagePlaceHolder3.getUrl();
}
String str2 = str;
if (!(pagePlaceHolder3 instanceof PagePlaceHolder)) {
iWebViewClient = QBWebviewWrapper.this.f46541d;
qBWebviewWrapper = QBWebviewWrapper.this;
iWebView = pagePlaceHolder3.getWebView();
} else if (z && (pagePlaceHolder instanceof View)) {
iWebViewClient = QBWebviewWrapper.this.f46541d;
qBWebviewWrapper = QBWebviewWrapper.this;
iWebView = nextWebView;
} else {
iWebViewClient = QBWebviewWrapper.this.f46541d;
qBWebviewWrapper = QBWebviewWrapper.this;
iWebView = pagePlaceHolder3 instanceof IWebView ? pagePlaceHolder3 : qBWebviewWrapper;
}
iWebViewClient.onBackForwardAnimationStarted(qBWebviewWrapper, iWebView, str2, z, canGoBack, canGoForward);
}
return z2;
}
Drawable[] snapshotForBackForward3 = QBWebviewWrapper.this.j.snapshotForBackForward(new int[]{goBackOrForwardToDesiredSteps}, true, new boolean[]{QBWebviewWrapper.this.g(goBackOrForwardToDesiredSteps)});
if (snapshotForBackForward3 == null || snapshotForBackForward3[0] == null) {
return false;
}
QBWebviewWrapper.this.a(snapshotForBackForward3[0], (Drawable) null);
View parentAnimationView2 = ((NewPageFrame) QBWebviewWrapper.this.f46541d).getParentAnimationView(1);
if (parentAnimationView2 != 0 && parentAnimationView2.getParent() != QBWebviewWrapper.this.i) {
QBWebviewWrapper.this.i.addView(parentAnimationView2);
if (QBWebviewWrapper.this.f46541d != null && QBWebviewWrapper.this.f46541d.getBussinessProxy().a(parentAnimationView2)) {
QBWebviewWrapper.this.a((Drawable) null, new PageScrollerBackgroundDrawable(WindowManager.a().x()));
}
}
if (z && (parentAnimationView2 instanceof IWebView)) {
b2 = ((IWebView) parentAnimationView2).getUrl();
}
if (parentAnimationView2 == 0) {
QBWebviewWrapper.this.e.setLastOffsetBy(QBWebviewWrapper.this.j);
}
str = b2;
pagePlaceHolder2 = parentAnimationView2;
}
z2 = true;
pagePlaceHolder = pagePlaceHolder2;
if (QBWebviewWrapper.this.f46541d != null) {
if (z) {
}
if (str == null) {
str = pagePlaceHolder3.getUrl();
}
String str22 = str;
if (!(pagePlaceHolder3 instanceof PagePlaceHolder)) {
}
iWebViewClient.onBackForwardAnimationStarted(qBWebviewWrapper, iWebView, str22, z, canGoBack, canGoForward);
}
return z2;
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
if (isIdle()) {
View view = (View) getCurrentItemView();
if (motionEvent.getY() > view.getHeight() - view.getPaddingBottom()) {
return false;
}
}
return super.onTouchEvent(motionEvent);
}
};
}
private void a(long j, long j2, String str, String str2, int i, int i2) {
IWebBackForwardList copyQBBackForwardList;
if (j - j2 <= this.V) {
this.W.clear();
QBWebView qBWebView = getQBWebView();
if (qBWebView == null || (copyQBBackForwardList = qBWebView.copyQBBackForwardList()) == null) {
return;
}
int i3 = 1;
if (str.equalsIgnoreCase(str2)) {
i3 = 2;
} else if (i2 >= 0 && i >= 0 && i2 - i < this.X) {
i3 = 4;
}
WebviewBackReportHelper.a().a(copyQBBackForwardList, i3);
if (i3 == 2) {
b().getBussinessProxy().a(str, 5);
}
}
}
public void a(Drawable drawable, Drawable drawable2) {
if (drawable != null) {
this.h.setBackgroundDrawable(drawable);
DrawableReleaseTask.a(new DrawableReleaseTask(this.j, drawable));
}
if (drawable2 != null) {
this.i.setBackgroundDrawable(drawable2);
DrawableReleaseTask.a(new DrawableReleaseTask(this.j, drawable2));
}
}
private void a(QBWebView qBWebView, String str) {
if (qBWebView != null) {
Bundle bundle = new Bundle();
bundle.putString("cancelFrom", str);
TraceEventCallback.a().c(qBWebView.getUrl(), bundle);
}
}
private void a(IWebBackForwardList iWebBackForwardList) {
if (iWebBackForwardList == null || iWebBackForwardList.a() == null || TextUtils.isEmpty(iWebBackForwardList.a().b())) {
return;
}
H5PerformanceTimingManager.a().e(iWebBackForwardList.a().b());
}
private boolean a(int i, IWebHistoryItem iWebHistoryItem) {
if (iWebHistoryItem == null) {
return true;
}
return AddressBarController.a().a(this, iWebHistoryItem.b(), true);
}
private void b(Context context) {
this.h = d(context);
this.h.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
this.i = c(context);
this.i.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
if (!WebEngine.b(context)) {
this.j.setPadding(0, this.F, 0, 0);
}
this.g = new ArrayList();
this.g.add(this.h);
this.g.add(this.j);
this.g.add(this.i);
this.f.notifyDataSetChanged();
this.e.setCurrentItem(1, false);
}
private QBFrameLayout c(Context context) {
return new QBFrameLayout(context) {
@Override
public void draw(Canvas canvas) {
int height;
try {
View childAt = getChildAt(0);
getHeight();
int width = getWidth();
if (childAt != null) {
int height2 = childAt.getHeight() - childAt.getPaddingBottom();
width = childAt.getWidth();
height = height2;
} else {
height = QBWebviewWrapper.this.j.getHeight() - QBWebviewWrapper.this.j.getPaddingBottom();
}
int save = canvas.save();
if (QBWebviewWrapper.this.K || !QBWebviewWrapper.this.L) {
canvas.translate(QBWebviewWrapper.this.j.getPaddingLeft(), getPaddingTop());
} else {
canvas.translate(QBWebviewWrapper.this.j.getPaddingLeft(), 0.0f);
}
canvas.clipRect(0, 0, width, height);
super.draw(canvas);
canvas.restoreToCount(save);
} catch (Exception unused) {
}
}
@Override
public int getPaddingBottom() {
View childAt = getChildAt(0);
return childAt != null ? childAt.getPaddingBottom() : QBWebviewWrapper.this.j.getPaddingBottom();
}
@Override
public int getPaddingTop() {
if (!(getBackground() instanceof X5ReleaseableDrawable) || QBWebviewWrapper.this.N || QBWebviewWrapper.this.T()) {
return 0;
}
return QBWebviewWrapper.this.F;
}
};
}
private QBFrameLayout d(Context context) {
return new QBFrameLayout(context) {
@Override
public void draw(Canvas canvas) {
int height;
try {
View childAt = getChildAt(0);
getHeight();
int width = getWidth();
if (childAt != null) {
int height2 = childAt.getHeight() - childAt.getPaddingBottom();
width = childAt.getWidth();
height = height2;
} else {
height = QBWebviewWrapper.this.j.getHeight() - QBWebviewWrapper.this.j.getPaddingBottom();
}
int save = canvas.save();
if (QBWebviewWrapper.this.J || QBWebviewWrapper.this.L) {
canvas.translate(QBWebviewWrapper.this.j.getPaddingLeft(), getPaddingTop());
} else {
canvas.translate(QBWebviewWrapper.this.j.getPaddingLeft(), 0.0f);
}
canvas.clipRect(0, 0, width, height);
super.draw(canvas);
canvas.restoreToCount(save);
} catch (Exception unused) {
}
}
@Override
public int getPaddingBottom() {
View childAt = getChildAt(0);
return childAt != null ? childAt.getPaddingBottom() : QBWebviewWrapper.this.j.getPaddingBottom();
}
@Override
public int getPaddingTop() {
if (!(getBackground() instanceof X5ReleaseableDrawable) || QBWebviewWrapper.this.N || QBWebviewWrapper.this.T()) {
return 0;
}
return QBWebviewWrapper.this.F;
}
};
}
public void e(int i) {
Handler handler;
Runnable runnable;
if (i < 1) {
if (this.h.getChildCount() <= 0) {
return;
}
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
this.f46541d.onBackForwardAnimationFinished(this, ((NewPageFrame) iWebViewClient).showPreviousPage(false));
((NewPageFrame) this.f46541d).releaseParentAnimationView(this.h.getChildAt(0));
}
handler = this.B;
runnable = new Runnable() {
@Override
public void run() {
QBWebviewWrapper.this.L();
}
};
} else {
if (i <= 1 || this.i.getChildCount() <= 0) {
return;
}
IWebViewClient iWebViewClient2 = this.f46541d;
if (iWebViewClient2 != null) {
this.f46541d.onBackForwardAnimationFinished(this, ((NewPageFrame) iWebViewClient2).showNextPage(false));
((NewPageFrame) this.f46541d).releaseParentAnimationView(this.i.getChildAt(0));
}
handler = this.B;
runnable = new Runnable() {
@Override
public void run() {
QBWebviewWrapper.this.L();
}
};
}
handler.post(runnable);
this.w = true;
this.B.removeCallbacks(this.C);
}
private void f(int i) {
QBWebView qBWebView = this.j;
if (qBWebView == null || qBWebView.getQBSettings() == null) {
return;
}
this.j.getQBSettings().a(FontSizeUtils.a(i));
}
private void g(String str) {
BootChainEvent.d("QBWebviewWrapper." + str).a(a.aO, String.valueOf(hashCode())).g();
}
public boolean g(int i) {
if (S()) {
return false;
}
IWebHistoryItem qBHistoryItem = this.j.getQBHistoryItem(i);
if (qBHistoryItem == null) {
return true;
}
return a(i, qBHistoryItem);
}
private HashMap<String, String> h(String str) {
HashMap<String, String> hashMap = new HashMap<>();
IWebviewHeaderExtension[] iWebviewHeaderExtensionArr = (IWebviewHeaderExtension[]) AppManifest.getInstance().queryExtensions(IWebviewHeaderExtension.class);
if (iWebviewHeaderExtensionArr != null && iWebviewHeaderExtensionArr.length > 0) {
for (IWebviewHeaderExtension iWebviewHeaderExtension : iWebviewHeaderExtensionArr) {
if (iWebviewHeaderExtension != null && iWebviewHeaderExtension.getHeader(str) != null) {
hashMap.putAll(iWebviewHeaderExtension.getHeader(str));
}
}
}
return hashMap;
}
public void j(boolean z) {
this.J = this.j.canGoBack();
this.K = this.j.canGoForward();
this.L = z;
}
private void y() {
this.G = SearchResultSkinManager.a().b() ? MttResources.d(e.aJ) : MttResources.c(e.aJ);
if (!SkinManager.s().f() || SearchResultSkinManager.a().b()) {
this.j.setBackgroundColor(this.G);
} else {
this.j.setBackgroundDrawable(MttResources.i(g.bm));
}
}
private QBTabHostAdapter z() {
return new QBTabHostAdapter() {
@Override
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
viewGroup.removeView((View) obj);
}
@Override
public int getCount() {
return QBWebviewWrapper.this.g.size();
}
@Override
public Object instantiateItem(ViewGroup viewGroup, int i) {
View view = (View) QBWebviewWrapper.this.g.get(i);
viewGroup.addView(view);
return view;
}
@Override
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
};
}
public WrapperViewPager a() {
return this.e;
}
public void a(int i) {
QBWebView E = E();
if (E != null) {
E.doTranslateAction(i);
}
}
public void a(int i, int i2, int i3, int i4) {
this.Q = i;
this.R = i2;
this.S = i3;
this.T = i4;
}
@Override
public void a(int i, boolean z, int i2, boolean z2) {
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
iWebViewClient.getBussinessProxy().a(this, this.j.getView(), i, z, i2, z2);
}
}
public void a(Bitmap bitmap, IWebView.RatioRespect ratioRespect, int i, Runnable runnable) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.snapshotVisibleUsingBitmap(bitmap, ratioRespect, i, runnable);
}
}
public void a(BitmapDrawable bitmapDrawable) {
this.O = bitmapDrawable;
this.e.invalidate();
}
public void a(Message message) {
F();
((WebViewTransport) message.obj).a(this.j);
message.sendToTarget();
}
public void a(FindListener findListener) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.setFindListener(findListener);
}
}
public void a(UrlParams urlParams) {
this.D = urlParams;
}
public void a(String str) {
this.k = str;
if (str != null) {
AddressBarDataSource addressBarDataSource = this.A;
addressBarDataSource.f35821b = str;
addressBarDataSource.e.a((byte) 0);
}
}
public void a(String str, String str2, String str3) {
QBWebView E = E();
if (E != null) {
E.loadData(str, str2, str3);
}
}
void a(String str, Map<String, String> map) {
if (this.j == null || TextUtils.isEmpty(str)) {
return;
}
HashMap<String, String> h = h(str);
if (map != null && map.size() > 0) {
h.putAll(map);
}
c(UserSettingManager.b().c());
TraceEventCallback.a().onHippyCustomTraceEvent(str, TraceEvent.TraceAction.WEB_LOAD_URL.name(), new Bundle());
if (this.Y) {
this.Y = false;
} else {
TraceEventCallback.a().onHippyCustomTraceEvent(str, "NEW_WEB_LOAD_URL", new Bundle());
this.j.loadUrl(str, h);
H5PerformanceTimingManager.a().c(str);
}
if (this.D != null) {
HashMap hashMap = new HashMap();
hashMap.put("entryData", this.D.r + "");
hashMap.put("searchEngineInfo", PublicSettingManager.a().getString("key_search_engine_info", ""));
this.j.setEntryDataForSearchTeam(hashMap);
}
}
public void a(HashMap<String, String> hashMap) {
this.y = hashMap;
this.z = getUrl();
}
public void a(boolean z) {
QBWebView E = E();
if (E != null) {
E.setRenderMode(z ? 2 : 0);
}
}
public void a(boolean z, int i, int i2) {
QBWebView E;
if (z && (E = E()) != null && !E.isEnableSetFont()) {
MttToaster.show(MttResources.l(R.string.c12), 0);
}
f(i2);
}
public boolean a(Bitmap.Config config, String str, boolean z, int i, int i2) {
QBWebView E = E();
if (E != null) {
return E.capturePageToFile(Bitmap.Config.RGB_565, str, true, 0, 0);
}
return false;
}
public boolean a(String str, boolean z) {
if (z) {
this.l = false;
}
if (this.l) {
return true;
}
if (!UrlUtils.isWebUrl(str) || !this.U) {
return false;
}
new UrlParams(str).c(0).e();
return true;
}
@Override
public void actionHome(byte b2) {
Bundle bundle = new Bundle();
bundle.putString("cancelFrom", "HOME");
TraceEventCallback.a().c(getUrl(), bundle);
stopLoading();
this.l = true;
}
@Override
public void active() {
g("active");
this.l = false;
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
iWebViewClient.getBussinessProxy().c(this);
}
this.s = true;
if (this.o) {
P();
}
}
@Override
public void addWrapperView(ViewGroup viewGroup, FrameLayout.LayoutParams layoutParams) {
}
public IWebViewClient b() {
return this.f46541d;
}
public void b(int i) {
IQQBrowserSettings qQBrowserSettings;
IQQBrowserSettings.ImageQuality imageQuality;
QBWebView E = E();
if (E != null) {
int i2 = UserSettingManager.b().getInt("KeyImageQualityOption", 1);
if (i2 == 0) {
qQBrowserSettings = E.getQQBrowserSettings();
imageQuality = IQQBrowserSettings.ImageQuality.LOW;
} else if (i2 == 1) {
qQBrowserSettings = E.getQQBrowserSettings();
imageQuality = IQQBrowserSettings.ImageQuality.MEDIUM;
} else {
if (i2 != 2) {
return;
}
qQBrowserSettings = E.getQQBrowserSettings();
imageQuality = IQQBrowserSettings.ImageQuality.HIGH;
}
qQBrowserSettings.a(imageQuality);
}
}
public void b(boolean z) {
QBWebView E = E();
if (E == null || !z) {
return;
}
E.freeMemory();
}
public boolean b(String str) {
return a(str, true);
}
@Override
public void back(boolean z) {
if (this.o) {
N();
boolean canGoForward = canGoForward();
boolean canGoBack = canGoBack();
j(false);
int goBackOrForwardToDesiredSteps = this.j.getGoBackOrForwardToDesiredSteps(-1);
if (!canGoBack || !this.e.isIdle()) {
if (this.e.isIdle()) {
return;
}
this.q += goBackOrForwardToDesiredSteps;
return;
}
if (goBackOrForwardToDesiredSteps != -1) {
this.j.goBackOrForward(goBackOrForwardToDesiredSteps);
return;
}
Drawable[] snapshotForBackForward = this.j.snapshotForBackForward(new int[]{-1}, false, new boolean[]{g(-1)});
if (snapshotForBackForward == null || snapshotForBackForward.length != 1 || snapshotForBackForward[0] == null) {
this.j.goBackOrForward(-1);
return;
}
D();
a(snapshotForBackForward[0], (Drawable) null);
WrapperViewPager wrapperViewPager = this.e;
wrapperViewPager.setCurrentItem(wrapperViewPager.getCurrentItem() - 1);
if (!isActive() || this.f46541d == null) {
return;
}
IWebHistoryItem qBHistoryItem = this.j.getQBHistoryItem(-1);
this.f46541d.onBackForwardAnimationStarted(this, this, qBHistoryItem != null ? qBHistoryItem.b() : null, false, canGoBack, canGoForward);
}
}
public void c(int i) {
QBWebView E = E();
if (E != null) {
E.setEyeShieldMode(i != -1, i);
}
}
public void c(String str) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.compatLoadUrl("javascript:window.x5onSkinSwitch&&window.x5onSkinSwitch(\"" + str + "\");");
}
}
public void c(boolean z) {
QBWebView E = E();
if (E == null || E.getQBSettingsExtension() == null) {
return;
}
E.getQBSettingsExtension().b(z);
}
public boolean c() {
return this.w;
}
@Override
public boolean can(int i) {
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
return iWebViewClient.getBussinessProxy().b(i, getUrl());
}
return false;
}
@Override
public void canEnterReadMode(ValueCallback<Boolean> valueCallback) {
this.j.canEnterReadMode(valueCallback);
}
@Override
public boolean canGoBack() {
if (!this.o) {
return false;
}
if (QBNewJsDialogFactory.c(this.j)) {
return true;
}
int i = this.q;
return i == 0 ? this.j.canGoBack() : this.j.canGoBackOrForward(i - 1);
}
@Override
public boolean canGoForward() {
if (!this.o) {
return false;
}
int i = this.q;
return i == 0 ? this.j.canGoForward() : this.j.canGoBackOrForward(i + 1);
}
@Override
public boolean canHandleUrl(String str) {
return QBUrlUtils.A(str);
}
@Override
public void clearBackForwardListFromCur() {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.clearBackForwardListFromCur();
}
}
@Override
public boolean coverToolbar() {
return false;
}
public void d(int i) {
QBWebViewClient qBWebViewClient;
if (i == 100 && (qBWebViewClient = this.u) != null && qBWebViewClient.mLoadType == 3) {
this.u.mLoadType = 0;
}
}
public void d(boolean z) {
QBWebView E = E();
if (E != null) {
E.getQBSettings().j(z);
}
}
public boolean d() {
return this.l;
}
public boolean d(String str) {
int i;
IWebBackForwardList copyQBBackForwardList = this.j.copyQBBackForwardList();
if (copyQBBackForwardList != null) {
int c2 = copyQBBackForwardList.c();
i = 0;
while (i < c2) {
IWebHistoryItem a2 = copyQBBackForwardList.a(i);
if (a2 != null && StringUtils.a(str, a2.b())) {
break;
}
i++;
}
}
i = -1;
if (i == -1) {
return false;
}
this.j.removeHistoryItem(i);
return true;
}
@Override
public void deactive() {
g("deactive");
a(this.j, "DEACTIVE");
this.s = false;
if (this.o) {
QBNewJsDialogFactory.b(this.j);
this.j.deactive();
this.f46541d.onAllMetaDataFinished(this, null);
JsCallback jsCallback = this.f46539a;
if (jsCallback != null) {
jsCallback.a(false);
}
D();
DrawableReleaseTask.b();
}
}
@Override
public void destroy() {
if (this.j != null) {
WebViewStatDataStore.getInstance().remove(this.j);
}
if (this.o) {
if (this.s) {
deactive();
}
this.Z.a();
QBNewJsDialogFactory.b(this.j);
this.j.destroy();
JsCallback jsCallback = this.f46539a;
if (jsCallback != null) {
jsCallback.c();
this.f46539a.g();
}
}
}
public void e(String str) {
Vector vector = new Vector();
IWebBackForwardList copyQBBackForwardList = this.j.copyQBBackForwardList();
if (copyQBBackForwardList != null) {
int c2 = copyQBBackForwardList.c();
for (int i = 0; i < c2; i++) {
IWebHistoryItem a2 = copyQBBackForwardList.a(i);
if (a2 != null && StringUtils.a(str, UrlUtils.getHostNew(a2.b()))) {
vector.add(Integer.valueOf(i));
}
}
}
while (true) {
try {
Integer num = (Integer) vector.lastElement();
if (num == null) {
return;
}
if (num.intValue() >= 0) {
this.j.removeHistoryItem(num.intValue());
vector.removeElement(num);
}
} catch (Exception unused) {
return;
}
}
}
public void e(boolean z) {
QBWebView E = E();
if (E == null || E.getQBSettingsExtension() == null) {
return;
}
E.getQBSettingsExtension().a(z);
}
public float[] e() {
return new float[]{0.0f, 0.0f};
}
@Override
public void enterReadMode(ValueCallback<Boolean> valueCallback, Runnable runnable) {
PlatformStatUtils.a("PIRATENOVEL_ENTERREADMODE");
this.j.enterReadMode(valueCallback, runnable);
}
@Override
public void exitReadMode() {
this.j.exitReadMode();
}
public int f(String str) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
return qBWebView.findAll(str);
}
return 0;
}
public VideoProxyDefault f() {
QBWebView E = E();
if (E != null) {
return E.getActiveVideoProxy();
}
return null;
}
public void f(boolean z) {
QBWebView E = E();
if (E != null) {
E.getQQBrowserSettings().a(z);
}
}
@Override
public void forward() {
if (this.o) {
if (ActivityHandler.b().m().b() != null && ActivityHandler.b().m().b() == ActivityHandler.b().n() && QBNewJsDialogFactory.c(this.j)) {
QBNewJsDialogFactory.b(this.j);
return;
}
boolean canGoForward = canGoForward();
boolean canGoBack = canGoBack();
j(true);
int goBackOrForwardToDesiredSteps = this.j.getGoBackOrForwardToDesiredSteps(1);
if (!canGoForward || !this.e.isIdle()) {
if (this.e.isIdle()) {
return;
}
this.q += goBackOrForwardToDesiredSteps;
return;
}
if (goBackOrForwardToDesiredSteps != 1) {
this.j.goBackOrForward(goBackOrForwardToDesiredSteps);
return;
}
Drawable[] snapshotForBackForward = this.j.snapshotForBackForward(new int[]{1}, false, new boolean[]{g(1)});
if (snapshotForBackForward == null || snapshotForBackForward.length != 1 || snapshotForBackForward[0] == null) {
this.j.goBackOrForward(1);
return;
}
D();
a((Drawable) null, snapshotForBackForward[0]);
WrapperViewPager wrapperViewPager = this.e;
wrapperViewPager.setCurrentItem(wrapperViewPager.getCurrentItem() + 1);
if (this.f46541d != null) {
IWebHistoryItem qBHistoryItem = this.j.getQBHistoryItem(1);
this.f46541d.onBackForwardAnimationStarted(this, this, qBHistoryItem != null ? qBHistoryItem.b() : null, true, canGoBack, canGoForward);
}
}
}
@Override
public void fromPage(String str, boolean z, boolean z2) {
}
public void g(boolean z) {
QBWebView E = E();
if (E != null) {
E.getQQBrowserSettings().b(z);
}
}
public boolean g() {
return this.j.isPluginFullScreen();
}
@Override
public AddressBarDataSource getAddressBarDataSource() {
return this.A;
}
@Override
public String getContentUrl() {
return this.z;
}
@Override
public Bundle getExtra() {
return this.E;
}
@Override
public IPage.INSTANT_TYPE getInstType() {
return IPage.INSTANT_TYPE.DEFAULT_MULTI;
}
@Override
public String getPageTitle() {
if (!this.o) {
return this.k;
}
if (Looper.myLooper() == Looper.getMainLooper()) {
return this.j.getTitle();
}
AddressBarDataSource addressBarDataSource = this.A;
if (addressBarDataSource == null) {
return null;
}
if (addressBarDataSource.f != null && !TextUtils.isEmpty(this.A.f.j)) {
return this.A.f.j;
}
if (TextUtils.isEmpty(this.A.f35820a)) {
return null;
}
return this.A.f35820a;
}
@Override
public View getPageView() {
return this.j;
}
@Override
public QBWebView getQBWebView() {
return this.j;
}
@Override
public int getRequestCode() {
return 0;
}
@Override
public String getRestoreUrl() {
return getUrl();
}
@Override
public int getResultCode() {
return 0;
}
@Override
public Intent getResultIntent() {
return null;
}
@Override
public PageInfo getShareBundle() {
ArrayList<H5VideoTime> allVideoTime;
PageInfo pageInfo = new PageInfo(0);
pageInfo.a(getPageTitle()).b(getUrl());
QBWebView E = E();
if (E != null && (allVideoTime = E.getAllVideoTime()) != null && allVideoTime.size() > 0) {
pageInfo.a(3);
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
String J = iWebViewClient.getBussinessProxy().J();
pageInfo.g(J);
pageInfo.h(J);
}
}
return pageInfo;
}
@Override
public String getUrl() {
if (!this.o) {
return this.k;
}
if (Looper.myLooper() == Looper.getMainLooper()) {
return this.j.getUrl();
}
AddressBarDataSource addressBarDataSource = this.A;
if (addressBarDataSource == null || addressBarDataSource.f == null) {
return null;
}
if (!TextUtils.isEmpty(this.A.f.i)) {
return this.A.f.i;
}
if (TextUtils.isEmpty(this.A.f35821b)) {
return null;
}
return this.A.f35821b;
}
@Override
public int getWebviewScrollY() {
return this.j.getWebViewScrollY();
}
@Override
public ViewGroup getWrapperView() {
return null;
}
public void h() {
this.j.dumpDisplayTree();
}
public void h(boolean z) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.findNext(z);
}
}
public void i() {
}
public void i(boolean z) {
IWebSettingsExtension qBSettingsExtension = this.j.getQBSettingsExtension();
if (qBSettingsExtension != null) {
qBSettingsExtension.d(!PublicSettingManager.a().e());
}
}
@Override
public boolean isActive() {
return this.s;
}
@Override
public boolean isBlankPage() {
return this.j.isBlankPage();
}
@Override
public boolean isForcePortalScreen() {
return false;
}
@Override
public boolean isHomePage() {
return false;
}
@Override
public boolean isPage(IWebView.TYPE type) {
return type == IWebView.TYPE.HTML;
}
@Override
public boolean isSelectMode() {
if (getQBWebView() != null) {
return getQBWebView().isSelectionMode() || getQBWebView().seletionStatus() == 1;
}
return false;
}
@Override
public boolean isSwitchSkinByMyself() {
return true;
}
public void j() {
if (this.o) {
this.j.removeSelectionView();
QBWebView qBWebView = getQBWebView();
if (qBWebView != null) {
qBWebView.leaveSelectionMode();
}
}
}
public boolean k() {
QBWebView E = E();
if (E != null) {
return E.isPluginFullScreen();
}
return false;
}
public void l() {
WebViewUtils.a(E(), (String) null);
}
@Override
public void loadUrl(String str) {
loadUrl(str, null);
}
@Override
public void loadUrl(final String str, final Map<String, String> map) {
TraceEventCallback.a().onHippyCustomTraceEvent(str, TraceEvent.TraceAction.REAL_LAUNCH.name(), new Bundle());
if (!WebEngine.e().g() && !this.U) {
this.k = str;
WebEngine.e().a(this);
} else if (Looper.myLooper() == Looper.getMainLooper()) {
F();
a(str, map);
} else {
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
QBWebviewWrapper.this.F();
QBWebviewWrapper.this.a(str, map);
}
});
}
AddressBarDataSource addressBarDataSource = this.A;
addressBarDataSource.f35820a = str;
addressBarDataSource.f35821b = str;
addressBarDataSource.e.a((byte) 0);
}
public boolean m() {
QBWebView E = E();
if (E != null) {
return E.isPreReadCanGoForward();
}
return false;
}
public void n() {
QBWebView E = E();
if (E != null) {
E.onPauseActiveDomObject();
}
}
@Override
public boolean needsGetureBackForwardAnimation(int i, boolean z) {
return false;
}
public void o() {
QBWebView E = E();
if (E != null) {
E.onResumeActiveDomObject();
}
}
@Override
public void onEnterIntoMultiwindow() {
}
@Override
public void onImageLoadConfigChanged() {
IWebViewClient iWebViewClient;
if (this.o) {
QBWebSettings qBSettings = this.j.getQBSettings();
if (qBSettings != null && (iWebViewClient = this.f46541d) != null) {
iWebViewClient.getBussinessProxy().a(qBSettings);
}
a().invalidate();
}
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
return false;
}
@Override
public boolean onKeyUp(int i, KeyEvent keyEvent) {
return false;
}
@Override
public void onLeaveFromMultiwindow() {
}
@Override
public boolean onOverScroll(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, boolean z) {
if (i4 <= 0 && i2 < 0) {
this.j.startPullDown();
return true;
}
ViewParent viewParent = (canGoBack() || canGoForward()) ? this.e : (ViewGroup) this.e.getParent();
if (viewParent != null && (viewParent instanceof QBViewPager)) {
((QBViewPager) viewParent).onOverScroll(i, i2, i3, i4, i5, i6, i7, i8, z);
}
return true;
}
@Override
public void onResult(int i, int i2, Intent intent) {
}
@Override
public void onSkinChangeFinished() {
IskinSwitchListener iskinSwitchListener = this.x;
if (iskinSwitchListener != null) {
iskinSwitchListener.a();
}
}
@Override
public void onSkinChanged() {
this.r = true;
B();
y();
Q();
this.e.postInvalidate();
}
@Override
public void onStart() {
if (this.o) {
QBWebView qBWebView = getQBWebView();
if (qBWebView != null) {
QBNewJsDialogFactory.a(this.j);
qBWebView.onResume();
}
JsCallback jsCallback = this.f46539a;
if (jsCallback != null) {
jsCallback.f();
}
}
}
@Override
public void onStatusBarVisible(boolean z) {
}
@Override
public void onStop() {
a(this.j, "ONSTOP");
if (this.o) {
JsCallback jsCallback = this.f46539a;
if (jsCallback != null) {
jsCallback.e();
}
QBWebView qBWebView = getQBWebView();
if (qBWebView != null) {
qBWebView.onPause();
}
}
}
@Override
public void onTrimMemory(int i) {
QBWebView E = E();
if (E != null) {
E.trimMemory(i);
}
}
@Override
public void onWebColorChanged() {
}
@Override
public void onWebCorePrepared() {
String str = this.k;
if (str != null) {
IPostDataBuf iPostDataBuf = this.m;
if (iPostDataBuf != null) {
postUrl(str, iPostDataBuf);
this.m = null;
} else {
if (str != null) {
loadUrl(str);
}
this.n = null;
}
this.k = null;
this.n = null;
} else if (this.n != null) {
F();
this.u.mLoadType = 3;
a(this.j.restoreState(this.n));
}
if (getAddressBarDataSource().c() != 0) {
a(getAddressBarDataSource().c(), false, 0, true);
}
WebEngine.e().b(this);
}
public void p() {
boolean z = UserSettingManager.b().getBoolean("Key4FitScreen", false);
IWebSettingsExtension qBSettingsExtension = this.j.getQBSettingsExtension();
if (qBSettingsExtension != null && qBSettingsExtension.b() != z) {
qBSettingsExtension.f(z);
}
WebViewUtils.a(this.j, (String) null);
}
@Override
public boolean pageDown(boolean z) {
if (this.o) {
return this.j.pageDown(false, this.e.getHeight());
}
return false;
}
@Override
public boolean pageUp(boolean z) {
if (this.o) {
return this.j.pageUp(false, this.e.getHeight());
}
return false;
}
@Override
public void pauseAudio() {
if (this.o) {
this.j.pauseAudio();
}
}
@Override
public void playAudio() {
if (this.o) {
this.j.playAudio();
}
}
@Override
public void postUrl(String str, IPostDataBuf iPostDataBuf) {
if (WebEngine.e().g()) {
F();
QBWebView E = E();
if (E != null) {
E.postUrl(str, iPostDataBuf.toByteArray());
}
} else {
this.k = str;
this.m = iPostDataBuf;
WebEngine.e().a(this);
}
AddressBarDataSource addressBarDataSource = this.A;
addressBarDataSource.f35820a = str;
addressBarDataSource.f35821b = str;
addressBarDataSource.e.a((byte) 0);
this.A.a(this);
}
@Override
public void preActive() {
}
@Override
public void preDeactive() {
}
@Override
public void pruneMemory() {
QBWebView E = E();
if (E != null) {
E.pruneMemoryCache();
}
}
public void q() {
QBWebView E;
if (!can(3) || (E = E()) == null) {
return;
}
E.enterSelectionMode(false);
}
public void r() {
QBWebView E = E();
if (E != null) {
E.reloadCustomMetaData();
UserSettingManager b2 = UserSettingManager.b();
a(false, 0, PublicSettingManager.a().getInt("font_size", -1));
boolean z = b2.getBoolean("Key4FitScreen", false);
if (E.getQBSettingsExtension() == null || E.getQBSettingsExtension().b() == z) {
return;
}
E.getQBSettingsExtension().f(z);
E.onPageTransFormationSettingChanged(z);
}
}
@Override
public void refreshSkin() {
if (this.r) {
if (SkinManager.s().f()) {
this.j.setBackgroundDrawable(MttResources.i(g.bm));
} else {
this.j.setBackgroundColor(this.G);
}
this.j.switchSkin(SkinManager.s().l(), g(0));
this.r = false;
}
}
@Override
public void reload() {
if (ActivityHandler.b().m().b() != null && ActivityHandler.b().m().b() == ActivityHandler.b().n() && QBNewJsDialogFactory.c(this.j)) {
QBNewJsDialogFactory.b(this.j);
}
this.j.reload();
H5PerformanceTimingManager.a().d(this.j.getUrl());
}
@Override
public void removeSelectionView() {
}
@Override
public void restoreState(String str, Bundle bundle) {
if (bundle != null) {
if (!WebEngine.e().g()) {
WebEngine.e().a(this);
this.n = bundle;
} else {
F();
this.u.mLoadType = 3;
a(this.j.restoreState(bundle));
}
}
}
@Override
public void rmSkinChangeListener() {
this.x = null;
}
public void s() {
this.j.onAppExit();
}
@Override
public void setExtra(Bundle bundle) {
this.E = bundle;
}
@Override
public void setRequestCode(int i) {
}
@Override
public void setResult(int i, Intent intent) {
}
@Override
public void setSkinChangeListener(IskinSwitchListener iskinSwitchListener) {
this.x = iskinSwitchListener;
}
@Override
public void setWebViewClient(IWebViewClient iWebViewClient) {
IWebViewClient iWebViewClient2 = this.f46541d;
this.f46541d = iWebViewClient;
if (iWebViewClient2 == null || iWebViewClient == iWebViewClient2) {
return;
}
M();
u();
}
@Override
public Picture snapshotVisible(int i, int i2, IWebView.RatioRespect ratioRespect, int i3) {
if (this.j == null) {
return null;
}
this.f46541d.getBussinessProxy().b(this.j);
return this.j.snapshotVisible(i, i2, ratioRespect, i3);
}
@Override
public Bitmap snapshotVisibleUsingBitmap(int i, int i2, IWebView.RatioRespect ratioRespect, int i3) {
if (getQBWebView() == null) {
return null;
}
IWebViewClient iWebViewClient = this.f46541d;
if (iWebViewClient != null) {
iWebViewClient.getBussinessProxy().b(this.j);
}
return this.j.snapshotVisibleUsingBitmap(i, i2, ratioRespect, i3);
}
@Override
public void snapshotVisibleUsingBitmap(Bitmap bitmap, IWebView.RatioRespect ratioRespect, int i) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.snapshotVisibleUsingBitmap(bitmap, ratioRespect, i);
}
}
@Override
public Picture snapshotWholePage(int i, int i2, IWebView.RatioRespect ratioRespect, int i3) {
return this.j.snapshotWholePage(i, i2, ratioRespect, i3);
}
@Override
public Bitmap snapshotWholePageUsingBitmap(int i, int i2, IWebView.RatioRespect ratioRespect, int i3) {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
return qBWebView.snapshotWholePageUsingBitmap(i, i2, ratioRespect, i3);
}
return null;
}
@Override
public IWebView.STATUS_BAR statusBarType() {
return SearchResultSkinManager.a().b() ? SkinManager.s().l() ? IWebView.STATUS_BAR.STATSU_LIGH : IWebView.STATUS_BAR.STATUS_DARK : IWebView.STATUS_BAR.DEFAULT;
}
@Override
public void stopLoading() {
this.j.stopLoading();
this.k = null;
}
public void t() {
IWebSettingsExtension qBSettingsExtension = this.j.getQBSettingsExtension();
if (qBSettingsExtension != null) {
qBSettingsExtension.c(!SkinManager.s().l());
}
}
@Override
public void toPage(String str) {
}
void u() {
IWebViewClient iWebViewClient;
if (Build.VERSION.SDK_INT < 17 || (iWebViewClient = this.f46541d) == null) {
return;
}
this.f46539a = iWebViewClient.getBussinessProxy().a(this, this.j, this.f46541d);
}
public String v() {
return this.z;
}
public void w() {
QBWebView qBWebView = this.j;
if (qBWebView != null) {
qBWebView.clearMatches();
}
}
public boolean x() {
return this.j.canScrollBackForward();
}
}