OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/webthemeengine_impl_win.h" | 5 #include "webkit/glue/webthemeengine_impl_win.h" |
6 | 6 |
7 #include <vsstyle.h> // To convert to ui::NativeTheme::State | 7 #include <vsstyle.h> // To convert to ui::NativeTheme::State |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
11 #include "skia/ext/skia_utils_win.h" | 11 #include "skia/ext/skia_utils_win.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
13 #include "ui/base/win/dpi.h" | |
13 #include "ui/native_theme/native_theme.h" | 14 #include "ui/native_theme/native_theme.h" |
14 | 15 |
15 using WebKit::WebCanvas; | 16 using WebKit::WebCanvas; |
16 using WebKit::WebColor; | 17 using WebKit::WebColor; |
17 using WebKit::WebRect; | 18 using WebKit::WebRect; |
18 using WebKit::WebSize; | 19 using WebKit::WebSize; |
19 | 20 |
20 namespace webkit_glue { | 21 namespace webkit_glue { |
21 | 22 |
22 static RECT WebRectToRECT(const WebRect& rect) { | 23 static RECT WebRectToRECT(const WebRect& rect) { |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
985 extra); | 986 extra); |
986 } | 987 } |
987 | 988 |
988 WebSize WebThemeEngineImpl::getSize(int part) { | 989 WebSize WebThemeEngineImpl::getSize(int part) { |
989 switch (part) { | 990 switch (part) { |
990 case SBP_ARROWBTN: { | 991 case SBP_ARROWBTN: { |
991 gfx::Size size = ui::NativeTheme::instance()->GetPartSize( | 992 gfx::Size size = ui::NativeTheme::instance()->GetPartSize( |
992 ui::NativeTheme::kScrollbarUpArrow, | 993 ui::NativeTheme::kScrollbarUpArrow, |
993 ui::NativeTheme::kNormal, | 994 ui::NativeTheme::kNormal, |
994 ui::NativeTheme::ExtraParams()); | 995 ui::NativeTheme::ExtraParams()); |
996 // 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
| |
997 if(size.width() == 0) { | |
tony
2013/02/21 18:46:26
Nit: Space missing after "if".
kevers
2013/02/21 19:12:23
Fixed.
| |
998 int width = static_cast<int>(GetSystemMetrics(SM_CXVSCROLL) / | |
999 ui::win::GetDeviceScaleFactor()); | |
1000 size = gfx::Size(width, width); | |
1001 } | |
995 return WebSize(size.width(), size.height()); | 1002 return WebSize(size.width(), size.height()); |
996 } | 1003 } |
997 default: | 1004 default: |
998 NOTREACHED() << "Unhandled part: " << part; | 1005 NOTREACHED() << "Unhandled part: " << part; |
999 } | 1006 } |
1000 return WebSize(); | 1007 return WebSize(); |
1001 } | 1008 } |
1002 | 1009 |
1003 } // namespace webkit_glue | 1010 } // namespace webkit_glue |
OLD | NEW |