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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/Tab.java

Issue 1026983002: Allow adding an overlay not attached to the tab layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attachToCC -> attachLayer Created 5 years, 9 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 | chrome/android/java/src/org/chromium/chrome/browser/tab/TransitionPageHelper.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index 210119e5b7e51c010a19befbdfc93746d3929bde..751eef7b0c6fe77fbddb145cdece0eb84c293bd9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -1387,25 +1387,36 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
}
/**
- * Adds a {@link ContentViewCore} to this {@link Tab} as an overlay object. This
- * {@link ContentViewCore} will be attached to the CC layer hierarchy and have all layout events
- * propagated to it. This {@link ContentViewCore} can be removed via
+ * Adds a {@link ContentViewCore} to this {@link Tab} as an overlay object.
+ * If attachLayer is set, the {@link ContentViewCore} will be attached to CC layer hierarchy.
+ * This {@link ContentViewCore} will have all layout events propagated to it.
+ * This {@link ContentViewCore} can be removed via
* {@link #detachOverlayContentViewCore(ContentViewCore)}.
* @param content The {@link ContentViewCore} to attach.
* @param visible Whether or not to make the content visible.
+ * @param attachLayer Whether or not to attach the content view to the CC layer hierarchy.
*/
- public void attachOverlayContentViewCore(ContentViewCore content, boolean visible) {
+ public void attachOverlayContentViewCore(
+ ContentViewCore content, boolean visible, boolean attachLayer) {
if (content == null) return;
assert !mOverlayContentViewCores.contains(content);
mOverlayContentViewCores.add(content);
- nativeAttachOverlayContentViewCore(mNativeTabAndroid, content, visible);
+ if (attachLayer) nativeAttachOverlayContentViewCore(mNativeTabAndroid, content, visible);
for (TabObserver observer : mObservers) {
observer.onOverlayContentViewCoreAdded(this, content);
}
}
/**
+ * TODO(aruslan): remove this.
+ * Temporary overload to avoid 2-way commit.
+ */
+ public void attachOverlayContentViewCore(ContentViewCore content, boolean visible) {
+ attachOverlayContentViewCore(content, visible, true);
+ }
+
+ /**
* Removes a {@link ContentViewCore} overlay object from this {@link Tab}. This
* {@link ContentViewCore} must have previously been added via
* {@link #attachOverlayContentViewCore(ContentViewCore, boolean)}.
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tab/TransitionPageHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698