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; |
| 43 class ScrollbarParent; |
44 class ScrollbarTheme; | 44 class ScrollbarTheme; |
45 class WebGestureEvent; | 45 class WebGestureEvent; |
46 class WebMouseEvent; | 46 class WebMouseEvent; |
47 | 47 |
48 class PLATFORM_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, | 48 class PLATFORM_EXPORT Scrollbar : public GarbageCollectedFinalized<Scrollbar>, |
49 public ScrollbarThemeClient, | 49 public ScrollbarThemeClient, |
50 public DisplayItemClient { | 50 public DisplayItemClient { |
51 public: | 51 public: |
52 static Scrollbar* Create(ScrollableArea* scrollable_area, | 52 static Scrollbar* Create(ScrollableArea* scrollable_area, |
53 ScrollbarOrientation orientation, | 53 ScrollbarOrientation orientation, |
(...skipping 14 matching lines...) Expand all Loading... |
68 ~Scrollbar() override; | 68 ~Scrollbar() override; |
69 | 69 |
70 // ScrollbarThemeClient implementation. | 70 // ScrollbarThemeClient implementation. |
71 int X() const override { return frame_rect_.X(); } | 71 int X() const override { return frame_rect_.X(); } |
72 int Y() const override { return frame_rect_.Y(); } | 72 int Y() const override { return frame_rect_.Y(); } |
73 int Width() const override { return frame_rect_.Width(); } | 73 int Width() const override { return frame_rect_.Width(); } |
74 int Height() const override { return frame_rect_.Height(); } | 74 int Height() const override { return frame_rect_.Height(); } |
75 IntSize Size() const override { return frame_rect_.Size(); } | 75 IntSize Size() const override { return frame_rect_.Size(); } |
76 IntPoint Location() const override { return frame_rect_.Location(); } | 76 IntPoint Location() const override { return frame_rect_.Location(); } |
77 | 77 |
78 virtual void SetParent(FrameViewBase* parent) { parent_ = parent; } | 78 virtual void SetParent(ScrollbarParent* parent) { parent_ = parent; } |
79 FrameViewBase* Parent() const { return parent_; } | 79 ScrollbarParent* Parent() const { return parent_; } |
80 | 80 |
81 void SetFrameRect(const IntRect&); | 81 void SetFrameRect(const IntRect&); |
82 IntRect FrameRect() const override { return frame_rect_; } | 82 IntRect FrameRect() const override { return frame_rect_; } |
83 | 83 |
84 ScrollbarOverlayColorTheme GetScrollbarOverlayColorTheme() const override; | 84 ScrollbarOverlayColorTheme GetScrollbarOverlayColorTheme() const override; |
85 void GetTickmarks(Vector<IntRect>&) const override; | 85 void GetTickmarks(Vector<IntRect>&) const override; |
86 bool IsScrollableAreaActive() const override; | 86 bool IsScrollableAreaActive() const override; |
87 | 87 |
88 IntPoint ConvertFromRootFrame( | 88 IntPoint ConvertPointFromRootFrame(const IntPoint&) const override; |
89 const IntPoint& point_in_root_frame) const override; | |
90 | 89 |
91 bool IsCustomScrollbar() const override { return false; } | 90 bool IsCustomScrollbar() const override { return false; } |
92 ScrollbarOrientation Orientation() const override { return orientation_; } | 91 ScrollbarOrientation Orientation() const override { return orientation_; } |
93 bool IsLeftSideVerticalScrollbar() const override; | 92 bool IsLeftSideVerticalScrollbar() const override; |
94 | 93 |
95 int Value() const override { return lroundf(current_pos_); } | 94 int Value() const override { return lroundf(current_pos_); } |
96 float CurrentPos() const override { return current_pos_; } | 95 float CurrentPos() const override { return current_pos_; } |
97 int VisibleSize() const override { return visible_size_; } | 96 int VisibleSize() const override { return visible_size_; } |
98 int TotalSize() const override { return total_size_; } | 97 int TotalSize() const override { return total_size_; } |
99 int Maximum() const override { return total_size_ - visible_size_; } | 98 int Maximum() const override { return total_size_ - visible_size_; } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 244 } |
246 | 245 |
247 float ScrollableAreaCurrentPos() const; | 246 float ScrollableAreaCurrentPos() const; |
248 float ScrollableAreaTargetPos() const; | 247 float ScrollableAreaTargetPos() const; |
249 bool ThumbWillBeUnderMouse() const; | 248 bool ThumbWillBeUnderMouse() const; |
250 | 249 |
251 int theme_scrollbar_thickness_; | 250 int theme_scrollbar_thickness_; |
252 bool track_needs_repaint_; | 251 bool track_needs_repaint_; |
253 bool thumb_needs_repaint_; | 252 bool thumb_needs_repaint_; |
254 LayoutRect visual_rect_; | 253 LayoutRect visual_rect_; |
255 Member<FrameViewBase> parent_; | 254 Member<ScrollbarParent> parent_; |
256 IntRect frame_rect_; | 255 IntRect frame_rect_; |
257 }; | 256 }; |
258 | 257 |
259 } // namespace blink | 258 } // namespace blink |
260 | 259 |
261 #endif // Scrollbar_h | 260 #endif // Scrollbar_h |
OLD | NEW |