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

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

Issue 449033002: Removing unwanted canPaste() api calls and unwanted layout attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build error 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index d02766dee16906fffa59bfe305e35e117a22e0e9..6e34a3f39cc26f4cc86838ec5a469673848a0a83 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -2438,7 +2438,7 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
private void showPastePopup(int xDip, int yDip) {
- if (!mHasInsertion) return;
+ if (!mHasInsertion || !canPaste()) return;
final float contentOffsetYPix = mRenderCoordinates.getContentOffsetYPix();
getPastePopup().showAt(
(int) mRenderCoordinates.fromDipToPix(xDip),
@@ -2453,16 +2453,17 @@ public class ContentViewCore
mImeAdapter.paste();
hideTextHandles();
}
- public boolean canPaste() {
- if (!mFocusedNodeEditable) return false;
- return ((ClipboardManager) mContext.getSystemService(
- Context.CLIPBOARD_SERVICE)).hasPrimaryClip();
- }
});
}
return mPastePopupMenu;
}
+ private boolean canPaste() {
+ if (!mFocusedNodeEditable) return false;
+ return ((ClipboardManager) mContext.getSystemService(
+ Context.CLIPBOARD_SERVICE)).hasPrimaryClip();
+ }
+
@SuppressWarnings("unused")
@CalledByNative
private void onRenderProcessChange() {

Powered by Google App Engine
This is Rietveld 408576698