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

Unified Diff: ui/snapshot/snapshot_android.cc

Issue 1144333004: Make WebView work for external displays (over Presentations). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixes according to boliu/jdduke's comments Created 5 years, 5 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: ui/snapshot/snapshot_android.cc
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc
index 433d0f7f439f13721e3bfacaae454c47c2a411e5..8af02e299ed42572d964f9bbe268fdb91a8dcd8d 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -39,9 +39,11 @@ static void MakeAsyncCopyRequest(
scoped_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateBitmapRequest(callback);
- const gfx::Display& display =
- gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
- float device_scale_factor = display.device_scale_factor();
+ float device_scale_factor =
+ gfx::Display::HasForceDeviceScaleFactor()
+ ? gfx::Display::GetForcedDeviceScaleFactor()
+ : window->GetDeviceDisplayInfo().GetDIPScale();
+
gfx::Rect source_rect_in_pixel =
gfx::ToEnclosingRect(gfx::ScaleRect(source_rect, device_scale_factor));
« ui/android/java/src/org/chromium/ui/base/WindowAndroid.java ('K') | « ui/gfx/screen_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698