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

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

Issue 2665623002: Fix Jumplist favicons to have high resolution in HDPI Windows displays (Closed)
Patch Set: Update comments and remove redundant .h files. Created 3 years, 11 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/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index 0ba4da99f9c2f521ade885f1997ac608cd8fbdc3..aefa7482ee19649035a6b26250bb96ca630aadb4 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -351,6 +351,18 @@ float ScreenWin::GetScaleFactorForHWND(HWND hwnd) {
return screen_win_display.display().device_scale_factor();
}
+// static
+float ScreenWin::GetLargestDeviceScaleFactor() {
sky 2017/02/02 22:41:16 This function is only needed in one place, can you
chengx 2017/02/03 01:51:13 Sure. Will make the code local to jumplist.
+ float scale = 1.0;
+ if (!g_screen_win_instance)
+ return scale;
+ std::vector<Display> displays(g_screen_win_instance->GetAllDisplays());
+ for (size_t i = 0; i < displays.size(); i++) {
sky 2017/02/02 22:41:16 no {}, also, I would use enhanced for loop
chengx 2017/02/03 01:51:13 Done.
+ scale = std::max(scale, displays[i].device_scale_factor());
+ }
+ return scale;
+}
+
HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
NOTREACHED();
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698