diff options
author | John Reck <jreck@google.com> | 2012-04-20 08:29:55 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-20 08:29:55 -0700 |
commit | 1221fcd31fdb3d51232a11622e556ce8ff11cacd (patch) | |
tree | 4db940db6b16428d3a07c5661743c2969556c035 /src | |
parent | abc01ce257a33415b8955cd20330ca6a5c08f4b6 (diff) | |
parent | 997b1b7695822cb2dc2deca0458a5649d00b9953 (diff) | |
download | packages_apps_browser-1221fcd31fdb3d51232a11622e556ce8ff11cacd.zip packages_apps_browser-1221fcd31fdb3d51232a11622e556ce8ff11cacd.tar.gz packages_apps_browser-1221fcd31fdb3d51232a11622e556ce8ff11cacd.tar.bz2 |
Merge "Support fallback key events"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Controller.java | 7 | ||||
-rw-r--r-- | src/com/android/browser/PreloadController.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/Tab.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/WebViewController.java | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 05ccdd2..36f6a1a 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -950,14 +950,15 @@ public class Controller } @Override - public void onUnhandledKeyEvent(KeyEvent event) { + public boolean onUnhandledKeyEvent(KeyEvent event) { if (!isActivityPaused()) { if (event.getAction() == KeyEvent.ACTION_DOWN) { - mActivity.onKeyDown(event.getKeyCode(), event); + return mActivity.onKeyDown(event.getKeyCode(), event); } else { - mActivity.onKeyUp(event.getKeyCode(), event); + return mActivity.onKeyUp(event.getKeyCode(), event); } } + return false; } @Override diff --git a/src/com/android/browser/PreloadController.java b/src/com/android/browser/PreloadController.java index 0efe119..66b89f4 100644 --- a/src/com/android/browser/PreloadController.java +++ b/src/com/android/browser/PreloadController.java @@ -130,8 +130,9 @@ public class PreloadController implements WebViewController { } @Override - public void onUnhandledKeyEvent(KeyEvent event) { + public boolean onUnhandledKeyEvent(KeyEvent event) { if (LOGD_ENABLED) Log.d(LOGTAG, "onUnhandledKeyEvent()"); + return false; } @Override diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index c73bdf6..cbda456 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -896,7 +896,9 @@ class Tab implements PictureListener { if (!mInForeground) { return; } - mWebViewController.onUnhandledKeyEvent(event); + if (!mWebViewController.onUnhandledKeyEvent(event)) { + super.onUnhandledKeyEvent(view, event); + } } @Override diff --git a/src/com/android/browser/WebViewController.java b/src/com/android/browser/WebViewController.java index 30eec4f..235fe97 100644 --- a/src/com/android/browser/WebViewController.java +++ b/src/com/android/browser/WebViewController.java @@ -63,7 +63,7 @@ public interface WebViewController { boolean shouldOverrideKeyEvent(KeyEvent event); - void onUnhandledKeyEvent(KeyEvent event); + boolean onUnhandledKeyEvent(KeyEvent event); void doUpdateVisitedHistory(Tab tab, boolean isReload); |