summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNewton Allen <newt@chromium.org>2015-01-05 11:00:01 -0800
committerNewton Allen <newt@chromium.org>2015-01-05 19:01:17 +0000
commit80eb4da34bfebe361dd4b2c296a295490bea1b53 (patch)
treecafef47bdd27075db03a4eeb14c58ce78f64d2aa
parentc28fd2aaa10822512c859e5d850b64e665c6c4b6 (diff)
downloadchromium_src-80eb4da34bfebe361dd4b2c296a295490bea1b53.zip
chromium_src-80eb4da34bfebe361dd4b2c296a295490bea1b53.tar.gz
chromium_src-80eb4da34bfebe361dd4b2c296a295490bea1b53.tar.bz2
Fix bug where accessibility could "see behind" infobars.
This swallows all hover events that are unhandled by an infobar before they reach the ContentView. This prevents a bug in accessibility mode where if the user clicked on an empty space in the infobar then an element from the webpage behind the infobar would be selected. BUG=430701 Review URL: https://codereview.chromium.org/824763002 Cr-Commit-Position: refs/heads/master@{#309454} (cherry picked from commit 1ea31ca6935e488fdbb116bf81316cec1e7453bf) Review URL: https://codereview.chromium.org/818733005 Cr-Commit-Position: refs/branch-heads/2214@{#379} Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java12
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java15
2 files changed, 16 insertions, 11 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java
index 16e64f2..be4c312 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java
@@ -21,11 +21,7 @@ import org.chromium.chrome.R;
import java.util.ArrayList;
/**
- * A wrapper class designed to:
- * - consume all touch events. This way the parent view (the FrameLayout ContentView) won't
- * have its onTouchEvent called. If it does, ContentView will process the touch click.
- * We don't want web content responding to clicks on the InfoBars.
- * - allow swapping out of children Views for animations.
+ * A wrapper class designed to allow swapping out of child Views for animations.
*
* Once an InfoBar has been hidden and removed from the InfoBarContainer, it cannot be reused
* because the main panel is discarded after the hiding animation.
@@ -72,12 +68,6 @@ public class ContentWrapperView extends FrameLayout {
return !mInfoBar.areControlsEnabled();
}
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- // Consume all motion events so they do not reach the ContentView.
- return true;
- }
-
/**
* Calculates how tall the InfoBar boundary should be in pixels.
* XHDPI devices and above get a double-tall boundary.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
index c2611c0..d9dd099 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
@@ -189,6 +189,21 @@ public class InfoBarContainer extends ScrollView {
return super.onInterceptTouchEvent(ev) || mAnimation != null;
}
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ // Consume all touch events so they do not reach the ContentView.
+ return true;
+ }
+
+ @Override
+ public boolean onHoverEvent(MotionEvent event) {
+ super.onHoverEvent(event);
+ // Consume all hover events so they do not reach the ContentView. In touch exploration mode,
+ // this prevents the user from interacting with the part of the ContentView behind the
+ // infobars. http://crbug.com/430701
+ return true;
+ }
+
private void addToParentView() {
if (mParentView != null && mParentView.indexOfChild(this) == -1) {
mParentView.addView(this);