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

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

Issue 2319913002: Fixed touch offset for Blimp (Closed)
Patch Set: comments Created 4 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 | « chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenManager.java ('k') | no next file » | 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/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
index edbaa1c0980a64a49dd6cdcdce10687735bf9045..f97f467908e0ad2af404f8aed63c22a52cd2777b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -23,9 +23,9 @@ import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
+import android.widget.FrameLayout.LayoutParams;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ApplicationStatus;
@@ -2876,6 +2876,21 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
mFullscreenManager.showControlsTransient();
updateFullscreenEnabledState();
}
+
+ // For blimp mode, offset the blimp view by the height of top controls. This will ensure
+ // that the view doesn't get clipped at the bottom of the page and also the touch offsets
+ // would work correctly.
+ if (getBlimpContents() != null && mFullscreenManager != null) {
+ ViewGroup blimpView = getBlimpContents().getView();
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) blimpView.getLayoutParams();
+ if (lp == null) {
+ lp = new FrameLayout.LayoutParams(
+ LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+ }
+
+ lp.topMargin = mFullscreenManager.getTopControlsHeight();
+ blimpView.setLayoutParams(lp);
+ }
}
/**
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698