Commit a0bfbf13 authored by henrika@chromium.org's avatar henrika@chromium.org

Revert 221946 "[Android WebView] Enable spatial navigation / DPAD"

> [Android WebView] Enable spatial navigation / DPAD
> 
> Turn on the --enable-spatial-navigation flag, and also bubble up
> unhandled DPAD events to the neighboring views in the view tree.
> Likewise, WebContentsDelegate::TakeFocus() bubble to logical next
> or previous neighbor view.
> 
> Also disabled the FileSystem API while in the area updating flags.
> 
> BUG=286698
> 
> Review URL: https://chromiumcodereview.appspot.com/23619024

TBR=joth@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221989 0039d316-1c4b-4281-b951-d872f2087c98
parent a820667b
......@@ -490,7 +490,7 @@ public class AwContents {
mLayoutSizer.setDelegate(new AwLayoutSizerDelegate());
mLayoutSizer.setDIPScale(mDIPScale);
mWebContentsDelegate = new AwWebContentsDelegateAdapter(contentsClient,
mLayoutSizer.getPreferredSizeChangedListener(), mContainerView);
mLayoutSizer.getPreferredSizeChangedListener());
mContentsClientBridge = new AwContentsClientBridge(contentsClient);
mZoomControls = new AwZoomControls(this);
mIoThreadClient = new IoThreadClientImpl();
......
......@@ -10,7 +10,6 @@ import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.ValueCallback;
......@@ -38,14 +37,11 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
final AwContentsClient mContentsClient;
final PreferredSizeChangedListener mPreferredSizeChangedListener;
final View mContainerView;
public AwWebContentsDelegateAdapter(AwContentsClient contentsClient,
PreferredSizeChangedListener preferredSizeChangedListener,
View containerView) {
PreferredSizeChangedListener preferredSizeChangedListener) {
mContentsClient = contentsClient;
mPreferredSizeChangedListener = preferredSizeChangedListener;
mContainerView = containerView;
}
@Override
......@@ -55,45 +51,9 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
@Override
public void handleKeyboardEvent(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
int direction;
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_DOWN:
direction = View.FOCUS_DOWN;
break;
case KeyEvent.KEYCODE_DPAD_UP:
direction = View.FOCUS_UP;
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
direction = View.FOCUS_LEFT;
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
direction = View.FOCUS_RIGHT;
break;
default:
direction = 0;
break;
}
if (direction != 0 && tryToMoveFocus(direction)) return;
}
mContentsClient.onUnhandledKeyEvent(event);
}
@Override
public boolean takeFocus(boolean reverse) {
int direction =
(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);
}
private boolean tryToMoveFocus(int direction) {
View focus = mContainerView.focusSearch(direction);
return focus != null && focus != mContainerView && focus.requestFocus();
}
@Override
public boolean addMessageToConsole(int level, String message, int lineNumber,
String sourceId) {
......
......@@ -64,14 +64,6 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
// Ganesh backed 2D-Canvas is not yet working and causes crashes.
cl->AppendSwitch(switches::kDisableAccelerated2dCanvas);
// File system API not supported (requires some new API; internal bug 6930981)
// TODO(joth): export and use switches::kDisableFileSystem
cl->AppendSwitch("disable-file-system");
// Enable D-PAD navigation for application compatibility.
// TODO(joth): export and use switches::EnableSpatialNavigation.
cl->AppendSwitch("enable-spatial-navigation");
return false;
}
......
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