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

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

Issue 631873004: Removing repeated retrieval of width and height for PastePopup menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/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 42af4e6df83707026950c9919bb6a8e4f8f5a17d..5e4ca3b031837b1d36239ef85a60f74448f5daeb 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
@@ -111,9 +111,9 @@ public class PastePopupMenu implements OnClickListener {
mRawPositionX = x;
mRawPositionY = y;
- View contentView = mContainer.getContentView();
- int width = contentView.getMeasuredWidth();
- int height = contentView.getMeasuredHeight();
+ final View contentView = mContainer.getContentView();
+ final int width = contentView.getMeasuredWidth();
+ final int height = contentView.getMeasuredHeight();
mPositionX = (int) (x - width / 2.0f);
mPositionY = y - height - mLineOffsetY;
@@ -130,11 +130,6 @@ public class PastePopupMenu implements OnClickListener {
final int screenWidth = mContext.getResources().getDisplayMetrics().widthPixels;
if (coords[1] < minOffsetY) {
- // Update dimensions from new view
- contentView = mContainer.getContentView();
- width = contentView.getMeasuredWidth();
- height = contentView.getMeasuredHeight();
-
// Vertical clipping, move under edited line and to the side of insertion cursor
// TODO bottom clipping in case there is no system bar
coords[1] += height;
« 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