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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2352773003: Fix the scale of Drag and Drop shadow image. (Closed)
Patch Set: Created 4 years, 3 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/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index b0a5fb69c8e61d0e7ca3e7ca888d189595d6af04..ae913a3e415be14f5dc4d93e4a9fa5ed7de7df7b 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -249,8 +249,11 @@ void WebContentsViewAndroid::StartDragging(
ScopedJavaLocalRef<jstring> jtext =
ConvertUTF16ToJavaString(env, drop_data.text.string());
+ float page_scale = content_view_core_->page_scale();
+ // No way to scale image.bitmap() itself. So we need to pass the page scale
+ // here and let the embedder do the scaling.
if (!native_view->StartDragAndDrop(
- jtext, gfx::ConvertToJavaBitmap(image.bitmap()))) {
+ jtext, gfx::ConvertToJavaBitmap(image.bitmap()), page_scale)) {
Ted C 2016/09/20 20:05:24 who generates the bitmap? In this case, were we g
hush (inactive) 2016/09/20 21:32:33 Blink generates it here. https://cs.chromium.org/c
// Need to clear drag and drop state in blink.
OnDragEnded();
return;
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698