Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java

Issue 624503002: Avoid sending WINDOW_CONTENT_CHANGED more than once when frame info changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
index 644652b3e5a133eb54458a48d99d2f174b8c81f4..1f456c1fbd282b7b89276723756431e926e1c5da 100644
--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
@@ -53,6 +53,7 @@ public class BrowserAccessibilityManager {
private final ViewGroup mView;
private boolean mUserHasTouchExplored;
private boolean mPendingScrollToMakeNodeVisible;
+ private boolean mNotifyFrameInfoInitializedCalled;
/**
* Create a BrowserAccessibilityManager object, which is owned by the C++
@@ -260,6 +261,11 @@ public class BrowserAccessibilityManager {
* web coordinates to screen coordinates.
*/
public void notifyFrameInfoInitialized() {
+ if (mNotifyFrameInfoInitializedCalled)
+ return;
+
+ mNotifyFrameInfoInitializedCalled = true;
+
// Invalidate the container view, since the chrome accessibility tree is now
// ready and listed as the child of the container view.
mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
@@ -380,6 +386,14 @@ public class BrowserAccessibilityManager {
return result;
}
+ /**
+ * Returns whether or not the frame info is initialized, meaning we can safely
+ * convert web coordinates to screen coordinates. When this is first initialized,
+ * notifyFrameInfoInitialized is called - but we shouldn't check whether or not
+ * that method was called as a way to determine if frame info is valid because
+ * notifyFrameInfoInitialized might not be called at all if mRenderCoordinates
+ * gets initialized first.
+ */
private boolean isFrameInfoInitialized() {
return mRenderCoordinates.getContentWidthCss() != 0.0 ||
mRenderCoordinates.getContentHeightCss() != 0.0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698