| 143 | } |
| 144 | |
| 145 | void GetDpiAwareWindowSize(int* width, int* height) { |
| 146 | int dpix = 0; |
| 147 | int dpiy = 0; |
| 148 | GetSystemDpi(&dpix, &dpiy); |
| 149 | double newZoomLevel = 0.0; |
| 150 | // 1. Using only "dpix" value to calculate zoom level. All |
| 151 | // modern displays have equal horizontal and vertical resolution. |
| 152 | // 2. Calculation for DPI < 96 is not yet supported (newZoomLevel<0.0). |
| 153 | newZoomLevel = (dpix - DEFAULT_DPIX) / 24; |
| 154 | if (newZoomLevel > 0.0) { |
| 155 | *width = *width + (int)ceil(newZoomLevel * 0.25 * (*width)); |
| 156 | *height = *height + (int)ceil(newZoomLevel * 0.25 * (*height)); |
| 157 | LOG(INFO) << "[Browser process] GetDpiAwareWindowSize():" |
| 158 | " enlarged by " << ceil(newZoomLevel * 0.25 * 100) << "%" |
| 159 | " new size = " << *width << "/" << *height; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void SetBrowserDpiSettings(CefRefPtr<CefBrowser> cefBrowser, |
| 164 | CefString autoZooming) { |
nothing calls this directly
no test coverage detected