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

Unified Diff: webkit/glue/webthemeengine_impl_win.cc

Issue 12330018: Fix the size of scrollbars when using the Windows Classic theme. (Closed) Base URL: http://git.chromium.org/chromium/src.git@views-toolbar
Patch Set: Add check to validate part size. Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webthemeengine_impl_win.cc
diff --git a/webkit/glue/webthemeengine_impl_win.cc b/webkit/glue/webthemeengine_impl_win.cc
index 132345b253accc07cb8a3240e2adf0ce4d02fc35..b201bba95e2ba1c9edc969f443c816ce7e474268 100644
--- a/webkit/glue/webthemeengine_impl_win.cc
+++ b/webkit/glue/webthemeengine_impl_win.cc
@@ -10,6 +10,7 @@
#include "skia/ext/platform_canvas.h"
#include "skia/ext/skia_utils_win.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h"
+#include "ui/base/win/dpi.h"
#include "ui/native_theme/native_theme.h"
using WebKit::WebCanvas;
@@ -992,6 +993,12 @@ WebSize WebThemeEngineImpl::getSize(int part) {
ui::NativeTheme::kScrollbarUpArrow,
ui::NativeTheme::kNormal,
ui::NativeTheme::ExtraParams());
+ // Part size retrieval can fail with the Windows Classic theme.
tony 2013/02/21 18:46:26 Does it always fail when using the Windows Classic
kevers 2013/02/21 19:12:23 Updated comment. Yes, the size of a scrollbar but
+ if(size.width() == 0) {
tony 2013/02/21 18:46:26 Nit: Space missing after "if".
kevers 2013/02/21 19:12:23 Fixed.
+ int width = static_cast<int>(GetSystemMetrics(SM_CXVSCROLL) /
+ ui::win::GetDeviceScaleFactor());
+ size = gfx::Size(width, width);
+ }
return WebSize(size.width(), size.height());
}
default:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698