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

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

Issue 312293002: Paste popup is positioning properly during content scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments and line breaks. 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 | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 coords[0] += handleHalfWidth + width / 2; 164 coords[0] += handleHalfWidth + width / 2;
165 } else { 165 } else {
166 coords[0] -= handleHalfWidth + width / 2; 166 coords[0] -= handleHalfWidth + width / 2;
167 } 167 }
168 } else { 168 } else {
169 // Horizontal clipping 169 // Horizontal clipping
170 coords[0] = Math.max(0, coords[0]); 170 coords[0] = Math.max(0, coords[0]);
171 coords[0] = Math.min(screenWidth - width, coords[0]); 171 coords[0] = Math.min(screenWidth - width, coords[0]);
172 } 172 }
173 173
174 mContainer.showAtLocation(mParent, Gravity.NO_GRAVITY, coords[0], coords [1]); 174 if (!isShowing()) {
175 mContainer.showAtLocation(mParent, Gravity.NO_GRAVITY, coords[0], co ords[1]);
176 } else {
177 mContainer.update(coords[0], coords[1], -1, -1);
178 }
175 } 179 }
176 180
177 private int viewIndex(boolean onTop) { 181 private int viewIndex(boolean onTop) {
178 return (onTop ? 0 : 1 << 1) + (canPaste() ? 0 : 1 << 0); 182 return (onTop ? 0 : 1 << 1) + (canPaste() ? 0 : 1 << 0);
179 } 183 }
180 184
181 private void updateContent(boolean onTop) { 185 private void updateContent(boolean onTop) {
182 final int viewIndex = viewIndex(onTop); 186 final int viewIndex = viewIndex(onTop);
183 View view = mPasteViews[viewIndex]; 187 View view = mPasteViews[viewIndex];
184 188
(...skipping 23 matching lines...) Expand all
208 } 212 }
209 213
210 private boolean canPaste() { 214 private boolean canPaste() {
211 return mDelegate.canPaste(); 215 return mDelegate.canPaste();
212 } 216 }
213 217
214 private void paste() { 218 private void paste() {
215 mDelegate.paste(); 219 mDelegate.paste();
216 } 220 }
217 } 221 }
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698