X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fandroid_webview%2Fjava%2Fsrc%2Forg%2Fchromium%2Fandroid_webview%2FAwWebContentsDelegateAdapter.java;h=3f2c707dce8447bc8b0abc5a24dc508ac6b8c1b2;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=e0a7a946197f7756185b36df4349b565b7306db8;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/src/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java index e0a7a94..3f2c707 100644 --- a/src/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java +++ b/src/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java @@ -19,8 +19,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,15 +28,19 @@ import org.chromium.content.browser.ContentViewCore; class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { private static final String TAG = "AwWebContentsDelegateAdapter"; - final AwContentsClient mContentsClient; - View mContainerView; - final Context mContext; + private final AwContents mAwContents; + private final AwContentsClient mContentsClient; + private final AwContentViewClient mContentViewClient; + private final Context mContext; + private View mContainerView; - public AwWebContentsDelegateAdapter(AwContentsClient contentsClient, - View containerView, Context context) { + public AwWebContentsDelegateAdapter(AwContents awContents, AwContentsClient contentsClient, + AwContentViewClient contentViewClient, Context context, View containerView) { + mAwContents = awContents; mContentsClient = contentsClient; - setContainerView(containerView); + mContentViewClient = contentViewClient; mContext = context; + setContainerView(containerView); } public void setContainerView(View containerView) { @@ -79,8 +81,8 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { @Override public boolean takeFocus(boolean reverse) { int direction = - (reverse == (mContainerView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL)) ? - View.FOCUS_RIGHT : View.FOCUS_LEFT; + (reverse == (mContainerView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL)) + ? View.FOCUS_RIGHT : View.FOCUS_LEFT; if (tryToMoveFocus(direction)) return true; direction = reverse ? View.FOCUS_UP : View.FOCUS_DOWN; return tryToMoveFocus(direction); @@ -135,7 +137,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,15 +149,15 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { final Handler handler = new Handler(ThreadUtils.getUiThreadLooper()) { @Override public void handleMessage(Message msg) { + 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: @@ -212,9 +214,10 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { @Override public void toggleFullscreenModeForTab(boolean enterFullscreen) { - if (!enterFullscreen) { - ContentVideoView videoView = ContentVideoView.getContentVideoView(); - if (videoView != null) videoView.exitFullscreen(false); + if (enterFullscreen) { + mContentViewClient.enterFullscreen(); + } else { + mContentViewClient.exitFullscreen(); } }