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