Chromium Code Reviews| 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; |