| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/platform/ScrollbarThemeWin.h" | 28 #include "core/platform/ScrollbarThemeWin.h" |
| 29 | 29 |
| 30 #include <windows.h> | 30 #include <windows.h> |
| 31 #include <vsstyle.h> | 31 #include <vsstyle.h> |
| 32 | 32 |
| 33 #include "core/platform/LayoutTestSupport.h" | 33 #include "core/platform/LayoutTestSupport.h" |
| 34 #include "core/platform/PlatformMouseEvent.h" | 34 #include "core/platform/PlatformMouseEvent.h" |
| 35 #include "core/platform/Scrollbar.h" | 35 #include "core/platform/Scrollbar.h" |
| 36 #include "core/platform/ScrollbarThemeOverlay.h" |
| 36 #include "core/platform/graphics/GraphicsContext.h" | 37 #include "core/platform/graphics/GraphicsContext.h" |
| 37 #include "core/platform/win/SystemInfo.h" | 38 #include "core/platform/win/SystemInfo.h" |
| 38 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
| 39 #include "public/platform/WebRect.h" | 40 #include "public/platform/WebRect.h" |
| 40 #include "public/platform/win/WebThemeEngine.h" | 41 #include "public/platform/win/WebThemeEngine.h" |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 ScrollbarTheme* ScrollbarTheme::nativeTheme() | 44 ScrollbarTheme* ScrollbarTheme::nativeTheme() |
| 44 { | 45 { |
| 46 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { |
| 47 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (7, 0, ScrollbarThemeO
verlay::AllowHitTest)); |
| 48 return &theme; |
| 49 } |
| 50 |
| 45 static ScrollbarThemeWin theme; | 51 static ScrollbarThemeWin theme; |
| 46 return &theme; | 52 return &theme; |
| 47 } | 53 } |
| 48 | 54 |
| 49 // The scrollbar size in DumpRenderTree on the Mac - so we can match their | 55 // The scrollbar size in DumpRenderTree on the Mac - so we can match their |
| 50 // layout results. Entries are for regular, small, and mini scrollbars. | 56 // layout results. Entries are for regular, small, and mini scrollbars. |
| 51 // Metrics obtained using [NSScroller scrollerWidthForControlSize:] | 57 // Metrics obtained using [NSScroller scrollerWidthForControlSize:] |
| 52 static const int kMacScrollbarSize[3] = { 15, 11, 15 }; | 58 static const int kMacScrollbarSize[3] = { 15, 11, 15 }; |
| 53 | 59 |
| 54 // Constants used to figure the drag rect outside which we should snap the | 60 // Constants used to figure the drag rect outside which we should snap the |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 int width = scrollbar->width() < 2 * girth ? scrollbar->width() / 2 : gi
rth; | 252 int width = scrollbar->width() < 2 * girth ? scrollbar->width() / 2 : gi
rth; |
| 247 return IntSize(width, thickness); | 253 return IntSize(width, thickness); |
| 248 } | 254 } |
| 249 | 255 |
| 250 int height = scrollbar->height() < 2 * girth ? scrollbar->height() / 2 : gir
th; | 256 int height = scrollbar->height() < 2 * girth ? scrollbar->height() / 2 : gir
th; |
| 251 return IntSize(thickness, height); | 257 return IntSize(thickness, height); |
| 252 } | 258 } |
| 253 | 259 |
| 254 | 260 |
| 255 } // namespace WebCore | 261 } // namespace WebCore |
| OLD | NEW |