| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "platform/PlatformMouseEvent.h" | 31 #include "platform/PlatformMouseEvent.h" |
| 32 #include "platform/scroll/ScrollableArea.h" | 32 #include "platform/scroll/ScrollableArea.h" |
| 33 #include "platform/scroll/ScrollAnimator.h" | 33 #include "platform/scroll/ScrollAnimator.h" |
| 34 #include "platform/scroll/Scrollbar.h" | 34 #include "platform/scroll/Scrollbar.h" |
| 35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 36 #include "public/platform/WebPoint.h" | 36 #include "public/platform/WebPoint.h" |
| 37 #include "public/platform/WebRect.h" | 37 #include "public/platform/WebRect.h" |
| 38 #include "public/platform/WebScrollbarBehavior.h" | 38 #include "public/platform/WebScrollbarBehavior.h" |
| 39 #include "public/platform/WebThemeEngine.h" | 39 #include "public/platform/WebThemeEngine.h" |
| 40 | 40 |
| 41 #if ((OS(POSIX) && !OS(MACOSX)) || OS(WIN)) | |
| 42 // The position of the scrollbar thumb affects the appearance of the steppers, s
o | 41 // The position of the scrollbar thumb affects the appearance of the steppers, s
o |
| 43 // when the thumb moves, we have to invalidate them for painting. | 42 // when the thumb moves, we have to invalidate them for painting. |
| 44 #define THUMB_POSITION_AFFECTS_BUTTONS | 43 #define THUMB_POSITION_AFFECTS_BUTTONS |
| 45 #endif | |
| 46 | 44 |
| 47 namespace blink { | 45 namespace blink { |
| 48 | 46 |
| 49 static const int kThumbThickness = 3; | 47 static const int kThumbThickness = 3; |
| 50 static const int kScrollbarMargin = 3; | 48 static const int kScrollbarMargin = 3; |
| 51 | 49 |
| 52 PassRefPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, Scrollba
rOrientation orientation) | 50 PassRefPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, Scrollba
rOrientation orientation) |
| 53 { | 51 { |
| 54 return adoptRef(new Scrollbar(scrollableArea, orientation)); | 52 return adoptRef(new Scrollbar(scrollableArea, orientation)); |
| 55 } | 53 } |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 thumbRect.setWidth(thumbRect.width() - kScrollbarMargin); | 615 thumbRect.setWidth(thumbRect.width() - kScrollbarMargin); |
| 618 if (isLeftSideVerticalScrollbar()) | 616 if (isLeftSideVerticalScrollbar()) |
| 619 thumbRect.setX(thumbRect.x() + kScrollbarMargin); | 617 thumbRect.setX(thumbRect.x() + kScrollbarMargin); |
| 620 } | 618 } |
| 621 | 619 |
| 622 DEFINE_STATIC_LOCAL(Color, color, (128, 128, 128, 128)); | 620 DEFINE_STATIC_LOCAL(Color, color, (128, 128, 128, 128)); |
| 623 context->fillRect(thumbRect, color); | 621 context->fillRect(thumbRect, color); |
| 624 } | 622 } |
| 625 | 623 |
| 626 } // namespace blink | 624 } // namespace blink |
| OLD | NEW |