Commit b47e8a0b authored by ajith.v's avatar ajith.v Committed by Commit bot

Removing the CVC parameter from ShowRepostFormWarningDialog Callback.

With this we can reduce the dependency of CVC on AW module. Hence removing
this unwanted parameter.

BUG=398263

Review URL: https://codereview.chromium.org/646693003

Cr-Commit-Position: refs/heads/master@{#299147}
parent 9a8e3d71
......@@ -581,8 +581,8 @@ public class AwContents {
mDIPScale = DeviceDisplayInfo.create(mContext).getDIPScale();
mLayoutSizer.setDelegate(new AwLayoutSizerDelegate());
mLayoutSizer.setDIPScale(mDIPScale);
mWebContentsDelegate = new AwWebContentsDelegateAdapter(
contentsClient, mContainerView, mContext);
mWebContentsDelegate = new AwWebContentsDelegateAdapter(this, contentsClient,
mContainerView, mContext);
mContentsClientBridge = new AwContentsClientBridge(contentsClient,
mBrowserContext.getKeyStore(), AwContentsStatics.getClientCertLookupTable());
mZoomControls = new AwZoomControls(this);
......
......@@ -20,7 +20,6 @@ import android.webkit.ValueCallback;
import org.chromium.base.ContentUriUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.ContentVideoView;
import org.chromium.content.browser.ContentViewCore;
/**
* Adapts the AwWebContentsDelegate interface to the AwContentsClient interface.
......@@ -30,12 +29,14 @@ import org.chromium.content.browser.ContentViewCore;
class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
private static final String TAG = "AwWebContentsDelegateAdapter";
final AwContents mAwContents;
final AwContentsClient mContentsClient;
View mContainerView;
final Context mContext;
public AwWebContentsDelegateAdapter(AwContentsClient contentsClient,
public AwWebContentsDelegateAdapter(AwContents awContents, AwContentsClient contentsClient,
View containerView, Context context) {
mAwContents = awContents;
mContentsClient = contentsClient;
setContainerView(containerView);
mContext = context;
......@@ -135,7 +136,7 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
}
@Override
public void showRepostFormWarningDialog(final ContentViewCore contentViewCore) {
public void showRepostFormWarningDialog() {
// TODO(mkosiba) We should be using something akin to the JsResultReceiver as the
// callback parameter (instead of ContentViewCore) and implement a way of converting
// that to a pair of messages.
......@@ -147,17 +148,15 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
final Handler handler = new Handler(ThreadUtils.getUiThreadLooper()) {
@Override
public void handleMessage(Message msg) {
if (contentViewCore.getWebContents() == null) return;
if (mAwContents.getNavigationController() == null) return;
switch(msg.what) {
case msgContinuePendingReload: {
contentViewCore.getWebContents().getNavigationController()
.continuePendingReload();
mAwContents.getNavigationController().continuePendingReload();
break;
}
case msgCancelPendingReload: {
contentViewCore.getWebContents().getNavigationController()
.cancelPendingReload();
mAwContents.getNavigationController().cancelPendingReload();
break;
}
default:
......
......@@ -209,7 +209,7 @@ public class Tab implements NavigationClient {
}
@Override
public void showRepostFormWarningDialog(final ContentViewCore contentViewCore) {
public void showRepostFormWarningDialog() {
RepostFormWarningDialog warningDialog = new RepostFormWarningDialog(
new Runnable() {
@Override
......
......@@ -8,7 +8,6 @@ import android.view.KeyEvent;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.content.browser.ContentViewCore;
/**
* Java peer of the native class of the same name.
......@@ -141,7 +140,7 @@ public class WebContentsDelegateAndroid {
* either of ContentViewCore.ContinuePendingReload or ContentViewCore.CancelPendingReload.
*/
@CalledByNative
public void showRepostFormWarningDialog(ContentViewCore contentViewCore) {
public void showRepostFormWarningDialog() {
}
@CalledByNative
......
......@@ -318,12 +318,7 @@ void WebContentsDelegateAndroid::ShowRepostFormWarningDialog(
ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
if (obj.is_null())
return;
ScopedJavaLocalRef<jobject> content_view_core =
content::ContentViewCore::FromWebContents(source)->GetJavaObject();
if (content_view_core.is_null())
return;
Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(),
content_view_core.obj());
Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj());
}
void WebContentsDelegateAndroid::ToggleFullscreenModeForTab(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment