diff options
author | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-09 07:16:25 +0000 |
---|---|---|
committer | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-09 07:16:25 +0000 |
commit | a0bfbf13bc09167561f4b529e87c83046f699df4 (patch) | |
tree | e9af82038eaf64f9b36664bdae927a41af4e028a | |
parent | a820667b51da834b4a666e995f0623a347e7d663 (diff) | |
download | chromium_src-a0bfbf13bc09167561f4b529e87c83046f699df4.zip chromium_src-a0bfbf13bc09167561f4b529e87c83046f699df4.tar.gz chromium_src-a0bfbf13bc09167561f4b529e87c83046f699df4.tar.bz2 |
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
3 files changed, 2 insertions, 50 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 631d5ed..d54a6101 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java @@ -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(); diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java index 7e3512d..da09a1a 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java +++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java @@ -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,46 +51,10 @@ 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) { ConsoleMessage.MessageLevel messageLevel = ConsoleMessage.MessageLevel.DEBUG; diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc index ff7dfbf..05911db 100644 --- a/android_webview/lib/main/aw_main_delegate.cc +++ b/android_webview/lib/main/aw_main_delegate.cc @@ -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; } |