Index: content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java b/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java |
index 0745d207edb7da317513c811b2d5eafad3224367..8baaeb07bf2c288c9d9a1b392f22fcb802dec1d0 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java |
@@ -27,6 +27,7 @@ public class PastePopupMenu implements OnClickListener { |
private int mRawPositionY; |
private int mPositionX; |
private int mPositionY; |
+ private int mStatusBarHeight; |
private final View[] mPasteViews; |
private final int[] mPasteViewLayouts; |
private final int mLineOffsetY; |
@@ -81,6 +82,13 @@ public class PastePopupMenu implements OnClickListener { |
5.0f, mContext.getResources().getDisplayMetrics()); |
mWidthOffsetX = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, |
30.0f, mContext.getResources().getDisplayMetrics()); |
+ mStatusBarHeight = 0; |
jdduke (slow)
2014/07/30 15:24:16
Nit: No need to initialize to 0, it will always be
kingshuk.j
2014/07/31 04:40:04
Done.
|
+ int resourceId = mContext.getResources() |
jdduke (slow)
2014/07/30 15:24:16
Can we call this statusBarHeightResourceId?
kingshuk.j
2014/07/31 04:40:04
Done.
|
+ .getIdentifier("status_bar_height", "dimen", "android"); |
+ if (resourceId > 0) { |
+ mStatusBarHeight = mContext.getResources() |
+ .getDimensionPixelSize(resourceId); |
+ } |
} |
/** |
@@ -131,8 +139,13 @@ public class PastePopupMenu implements OnClickListener { |
coords[0] += mPositionX; |
coords[1] += mPositionY; |
+ int statusBarHeight = 0; |
jdduke (slow)
2014/07/30 15:24:16
Let's rename this to something like |minOffsetY|.
kingshuk.j
2014/07/31 04:40:04
Done.
|
+ if (mParent.getSystemUiVisibility() == View.SYSTEM_UI_FLAG_VISIBLE) { |
+ statusBarHeight = mStatusBarHeight; |
+ } |
+ |
final int screenWidth = mContext.getResources().getDisplayMetrics().widthPixels; |
- if (coords[1] < 0) { |
+ if (coords[1] < statusBarHeight) { |
updateContent(false); |
// Update dimensions from new view |
contentView = mContainer.getContentView(); |