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

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

Issue 421173002: Paste PopupMenu gets cropped by StatusBar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser.input; 5 package org.chromium.content.browser.input;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.res.TypedArray; 8 import android.content.res.TypedArray;
9 import android.util.TypedValue; 9 import android.util.TypedValue;
10 import android.view.Gravity; 10 import android.view.Gravity;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 int height = contentView.getMeasuredHeight(); 124 int height = contentView.getMeasuredHeight();
125 125
126 mPositionX = (int) (x - width / 2.0f); 126 mPositionX = (int) (x - width / 2.0f);
127 mPositionY = y - height - mLineOffsetY; 127 mPositionY = y - height - mLineOffsetY;
128 128
129 final int[] coords = new int[2]; 129 final int[] coords = new int[2];
130 mParent.getLocationInWindow(coords); 130 mParent.getLocationInWindow(coords);
131 coords[0] += mPositionX; 131 coords[0] += mPositionX;
132 coords[1] += mPositionY; 132 coords[1] += mPositionY;
133 133
134 int statusBarHeight = 0;
135 int resourceId = mContext.getResources().getIdentifier("status_bar_heigh t", "dimen", "android");
jdduke (slow) 2014/07/28 15:46:03 What guarantees do we have that the status bar wil
kingshuk.j 2014/07/29 11:09:27 ok, I will put a check for the status bar visibili
136 if (resourceId > 0) {
137 statusBarHeight = mContext.getResources().getDimensionPixelSize(reso urceId);
138 }
134 final int screenWidth = mContext.getResources().getDisplayMetrics().widt hPixels; 139 final int screenWidth = mContext.getResources().getDisplayMetrics().widt hPixels;
135 if (coords[1] < 0) { 140 if (coords[1] < statusBarHeight) {
136 updateContent(false); 141 updateContent(false);
137 // Update dimensions from new view 142 // Update dimensions from new view
138 contentView = mContainer.getContentView(); 143 contentView = mContainer.getContentView();
139 width = contentView.getMeasuredWidth(); 144 width = contentView.getMeasuredWidth();
140 height = contentView.getMeasuredHeight(); 145 height = contentView.getMeasuredHeight();
141 146
142 // Vertical clipping, move under edited line and to the side of inse rtion cursor 147 // Vertical clipping, move under edited line and to the side of inse rtion cursor
143 // TODO bottom clipping in case there is no system bar 148 // TODO bottom clipping in case there is no system bar
144 coords[1] += height; 149 coords[1] += height;
145 coords[1] += mLineOffsetY; 150 coords[1] += mLineOffsetY;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 200 }
196 201
197 private boolean canPaste() { 202 private boolean canPaste() {
198 return mDelegate.canPaste(); 203 return mDelegate.canPaste();
199 } 204 }
200 205
201 private void paste() { 206 private void paste() {
202 mDelegate.paste(); 207 mDelegate.paste();
203 } 208 }
204 } 209 }
OLDNEW
« 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