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

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

Issue 1716653002: Implement OverlayPanels as SceneOverlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 0f29638937d97ae92300dc06ee9ef87ebcd6d3f2..7a5609d994267000971313e1020ec891be9c108c 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1507,8 +1507,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
@SuppressWarnings("javadoc")
public void onAttachedToWindow() {
setAccessibilityState(mAccessibilityManager.isEnabled());
- setTextHandlesTemporarilyHidden(false);
- restoreSelectionPopupsIfNecessary();
+ updateTextSelectionUI(true);
ScreenOrientationListener.getInstance().addObserver(this, mContext);
GamepadList.onAttachedToWindow(mContext);
mAccessibilityManager.addAccessibilityStateChangeListener(this);
@@ -1516,6 +1515,20 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
}
/**
+ * Update the text selection UI depending on the focus of the page. This will hide the selection
+ * handles and selection popups if focus is lost.
+ * @param focused If the ContentViewCore currently has focus.
+ */
+ public void updateTextSelectionUI(boolean focused) {
pedro (no code reviews) 2016/05/04 22:59:34 Have you talked to aelias@ about this issue, who n
mdjones 2016/05/05 00:46:21 I'll chat some more with the content people. I hav
pedro (no code reviews) 2016/05/05 01:40:52 I'm surprised that we're okay with allowing other
mdjones 2016/05/05 17:48:34 That's true, but in a similar manner a bug in the
pedro (no code reviews) 2016/05/05 19:12:16 But you seem to have missed the point. The selecti
mdjones 2016/05/05 20:46:02 Acknowledged.
+ setTextHandlesTemporarilyHidden(!focused);
+ if (focused) {
+ restoreSelectionPopupsIfNecessary();
+ } else {
+ hidePopupsAndPreserveSelection();
+ }
+ }
+
+ /**
* @see View#onDetachedFromWindow()
*/
@SuppressWarnings("javadoc")
@@ -1532,8 +1545,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
// Override the handle visibility explicitly to address this, but
// preserve the underlying selection for detachment cases like screen
// locking and app switching.
- setTextHandlesTemporarilyHidden(true);
- hidePopupsAndPreserveSelection();
+ updateTextSelectionUI(false);
mSystemCaptioningBridge.removeListener(this);
}

Powered by Google App Engine
This is Rietveld 408576698