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

Unified Diff: ui/display/win/screen_win.cc

Issue 2207043002: SetDeviceScaleFactorForTest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetDeviceScaleFactorForTest Created 4 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
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/snapshot/snapshot_aura_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index d9f85c364bfe6f3aa5cf6329878da36ed1fca2a1..1d554bddf313e821f5cef1568af1b4cb955a9d8f 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -430,6 +430,14 @@ gfx::Rect ScreenWin::DIPToScreenRectInWindow(gfx::NativeView view,
return DIPToScreenRect(hwnd, dip_rect);
}
+void ScreenWin::SetDeviceScaleFactorForTest(float scale_factor) {
+ LOG(ERROR) << "Set DSF:" << scale_factor;
+ display::Display::SetForceDeviceScaleFactorForTesting(scale_factor);
+ std::vector<display::Display> old_displays = GetAllDisplays();
+ UpdateFromDisplayInfos(GetDisplayInfosFromSystem());
+ change_notifier_.NotifyDisplaysChanged(old_displays, GetAllDisplays());
+}
+
void ScreenWin::UpdateFromDisplayInfos(
const std::vector<DisplayInfo>& display_infos) {
screen_win_displays_ = DisplayInfosToScreenWinDisplays(display_infos);
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/snapshot/snapshot_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698