Index: ui/native_theme/native_theme_win.cc |
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc |
index 74b4f14a26163b5e27c5c8b1828c7f4500a674d6..bf21dcbd17808e7fb23f1280e119a3139e8c86e4 100644 |
--- a/ui/native_theme/native_theme_win.cc |
+++ b/ui/native_theme/native_theme_win.cc |
@@ -233,7 +233,6 @@ gfx::Size NativeThemeWin::GetPartSize(Part part, |
// The GetThemePartSize call below returns the default size without |
// accounting for user customization (crbug/218291). |
- SIZE size; |
switch (part) { |
case kScrollbarDownArrow: |
case kScrollbarLeftArrow: |
@@ -242,14 +241,18 @@ gfx::Size NativeThemeWin::GetPartSize(Part part, |
case kScrollbarHorizontalThumb: |
case kScrollbarVerticalThumb: |
case kScrollbarHorizontalTrack: |
- case kScrollbarVerticalTrack: |
- size.cx = size.cy = gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); |
- return gfx::Size(size.cx, size.cy); |
+ case kScrollbarVerticalTrack: { |
+ int size = gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); |
+ if (size == 0) |
+ size = 17; |
+ return gfx::Size(size, size); |
+ } |
} |
int part_id = GetWindowsPart(part, state, extra); |
int state_id = GetWindowsState(part, state, extra); |
+ SIZE size; |
HDC hdc = GetDC(NULL); |
HRESULT hr = GetThemePartSize(GetThemeName(part), hdc, part_id, state_id, |
NULL, TS_TRUE, &size); |