| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, 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 18 matching lines...) Expand all Loading... |
| 29 #include "platform/Timer.h" | 29 #include "platform/Timer.h" |
| 30 #include "platform/graphics/paint/DisplayItem.h" | 30 #include "platform/graphics/paint/DisplayItem.h" |
| 31 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
| 32 #include "platform/scroll/ScrollTypes.h" | 32 #include "platform/scroll/ScrollTypes.h" |
| 33 #include "platform/scroll/ScrollbarThemeClient.h" | 33 #include "platform/scroll/ScrollbarThemeClient.h" |
| 34 #include "platform/wtf/MathExtras.h" | 34 #include "platform/wtf/MathExtras.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class CullRect; | 38 class CullRect; |
| 39 class FrameViewBase; | |
| 40 class GraphicsContext; | 39 class GraphicsContext; |
| 41 class IntRect; | 40 class IntRect; |
| 42 class PlatformChromeClient; | 41 class PlatformChromeClient; |
| 43 class ScrollableArea; | 42 class ScrollableArea; |
| 44 class ScrollbarTheme; | 43 class ScrollbarTheme; |
| 45 class WebGestureEvent; | 44 class WebGestureEvent; |
| 46 class WebMouseEvent; | 45 class WebMouseEvent; |
| 47 | 46 |
| 48 class PLATFORM_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, | 47 class PLATFORM_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, |
| 49 public ScrollbarThemeClient, | 48 public ScrollbarThemeClient, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 ~Scrollbar() override; | 67 ~Scrollbar() override; |
| 69 | 68 |
| 70 // ScrollbarThemeClient implementation. | 69 // ScrollbarThemeClient implementation. |
| 71 int X() const override { return frame_rect_.X(); } | 70 int X() const override { return frame_rect_.X(); } |
| 72 int Y() const override { return frame_rect_.Y(); } | 71 int Y() const override { return frame_rect_.Y(); } |
| 73 int Width() const override { return frame_rect_.Width(); } | 72 int Width() const override { return frame_rect_.Width(); } |
| 74 int Height() const override { return frame_rect_.Height(); } | 73 int Height() const override { return frame_rect_.Height(); } |
| 75 IntSize Size() const override { return frame_rect_.Size(); } | 74 IntSize Size() const override { return frame_rect_.Size(); } |
| 76 IntPoint Location() const override { return frame_rect_.Location(); } | 75 IntPoint Location() const override { return frame_rect_.Location(); } |
| 77 | 76 |
| 78 virtual void SetParent(FrameViewBase* parent) { parent_ = parent; } | |
| 79 FrameViewBase* Parent() const { return parent_; } | |
| 80 | |
| 81 void SetFrameRect(const IntRect&); | 77 void SetFrameRect(const IntRect&); |
| 82 IntRect FrameRect() const override { return frame_rect_; } | 78 IntRect FrameRect() const override { return frame_rect_; } |
| 83 | 79 |
| 84 ScrollbarOverlayColorTheme GetScrollbarOverlayColorTheme() const override; | 80 ScrollbarOverlayColorTheme GetScrollbarOverlayColorTheme() const override; |
| 85 void GetTickmarks(Vector<IntRect>&) const override; | 81 void GetTickmarks(Vector<IntRect>&) const override; |
| 86 bool IsScrollableAreaActive() const override; | 82 bool IsScrollableAreaActive() const override; |
| 87 | 83 |
| 88 IntPoint ConvertFromRootFrame( | 84 IntPoint ConvertFromRootFrame(const IntPoint&) const override; |
| 89 const IntPoint& point_in_root_frame) const override; | |
| 90 | 85 |
| 91 bool IsCustomScrollbar() const override { return false; } | 86 bool IsCustomScrollbar() const override { return false; } |
| 92 ScrollbarOrientation Orientation() const override { return orientation_; } | 87 ScrollbarOrientation Orientation() const override { return orientation_; } |
| 93 bool IsLeftSideVerticalScrollbar() const override; | 88 bool IsLeftSideVerticalScrollbar() const override; |
| 94 | 89 |
| 95 int Value() const override { return lroundf(current_pos_); } | 90 int Value() const override { return lroundf(current_pos_); } |
| 96 float CurrentPos() const override { return current_pos_; } | 91 float CurrentPos() const override { return current_pos_; } |
| 97 int VisibleSize() const override { return visible_size_; } | 92 int VisibleSize() const override { return visible_size_; } |
| 98 int TotalSize() const override { return total_size_; } | 93 int TotalSize() const override { return total_size_; } |
| 99 int Maximum() const override { return total_size_ - visible_size_; } | 94 int Maximum() const override { return total_size_ - visible_size_; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 110 // This returns device-scale-factor-aware pixel value. | 105 // This returns device-scale-factor-aware pixel value. |
| 111 // e.g. 15 in dsf=1.0, 30 in dsf=2.0. | 106 // e.g. 15 in dsf=1.0, 30 in dsf=2.0. |
| 112 // This returns 0 for overlay scrollbars. | 107 // This returns 0 for overlay scrollbars. |
| 113 // See also ScrolbarTheme::scrollbatThickness(). | 108 // See also ScrolbarTheme::scrollbatThickness(). |
| 114 int ScrollbarThickness() const; | 109 int ScrollbarThickness() const; |
| 115 | 110 |
| 116 // Called by the ScrollableArea when the scroll offset changes. | 111 // Called by the ScrollableArea when the scroll offset changes. |
| 117 // Will trigger paint invalidation if required. | 112 // Will trigger paint invalidation if required. |
| 118 void OffsetDidChange(); | 113 void OffsetDidChange(); |
| 119 | 114 |
| 120 void DisconnectFromScrollableArea(); | 115 virtual void DisconnectFromScrollableArea(); |
| 121 ScrollableArea* GetScrollableArea() const { return scrollable_area_; } | 116 ScrollableArea* GetScrollableArea() const { return scrollable_area_; } |
| 122 | 117 |
| 123 int PressedPos() const { return pressed_pos_; } | 118 int PressedPos() const { return pressed_pos_; } |
| 124 | 119 |
| 125 virtual void SetHoveredPart(ScrollbarPart); | 120 virtual void SetHoveredPart(ScrollbarPart); |
| 126 virtual void SetPressedPart(ScrollbarPart); | 121 virtual void SetPressedPart(ScrollbarPart); |
| 127 | 122 |
| 128 void SetProportion(int visible_size, int total_size); | 123 void SetProportion(int visible_size, int total_size); |
| 129 void SetPressedPos(int p) { pressed_pos_ = p; } | 124 void SetPressedPos(int p) { pressed_pos_ = p; } |
| 130 | 125 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 240 } |
| 246 | 241 |
| 247 float ScrollableAreaCurrentPos() const; | 242 float ScrollableAreaCurrentPos() const; |
| 248 float ScrollableAreaTargetPos() const; | 243 float ScrollableAreaTargetPos() const; |
| 249 bool ThumbWillBeUnderMouse() const; | 244 bool ThumbWillBeUnderMouse() const; |
| 250 | 245 |
| 251 int theme_scrollbar_thickness_; | 246 int theme_scrollbar_thickness_; |
| 252 bool track_needs_repaint_; | 247 bool track_needs_repaint_; |
| 253 bool thumb_needs_repaint_; | 248 bool thumb_needs_repaint_; |
| 254 LayoutRect visual_rect_; | 249 LayoutRect visual_rect_; |
| 255 Member<FrameViewBase> parent_; | |
| 256 IntRect frame_rect_; | 250 IntRect frame_rect_; |
| 257 }; | 251 }; |
| 258 | 252 |
| 259 } // namespace blink | 253 } // namespace blink |
| 260 | 254 |
| 261 #endif // Scrollbar_h | 255 #endif // Scrollbar_h |
| OLD | NEW |