Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: sky/engine/platform/scroll/Scrollbar.h

Issue 870073003: Remove mouse events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 #include "sky/engine/platform/scroll/ScrollTypes.h" 31 #include "sky/engine/platform/scroll/ScrollTypes.h"
32 #include "sky/engine/platform/scroll/Scrollbar.h" 32 #include "sky/engine/platform/scroll/Scrollbar.h"
33 #include "sky/engine/wtf/MathExtras.h" 33 #include "sky/engine/wtf/MathExtras.h"
34 #include "sky/engine/wtf/PassRefPtr.h" 34 #include "sky/engine/wtf/PassRefPtr.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class GraphicsContext; 38 class GraphicsContext;
39 class IntRect; 39 class IntRect;
40 class PlatformGestureEvent; 40 class PlatformGestureEvent;
41 class PlatformMouseEvent;
42 class ScrollableArea; 41 class ScrollableArea;
43 42
44 class PLATFORM_EXPORT Scrollbar final : public Widget { 43 class PLATFORM_EXPORT Scrollbar final : public Widget {
45 public: 44 public:
46 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation); 45 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation);
47 46
48 virtual ~Scrollbar(); 47 virtual ~Scrollbar();
49 48
50 bool isScrollableAreaActive() const; 49 bool isScrollableAreaActive() const;
51 50
(...skipping 20 matching lines...) Expand all
72 void setProportion(int visibleSize, int totalSize); 71 void setProportion(int visibleSize, int totalSize);
73 void setPressedPos(int p) { m_pressedPos = p; } 72 void setPressedPos(int p) { m_pressedPos = p; }
74 73
75 virtual void paint(GraphicsContext*, const IntRect& damageRect) override; 74 virtual void paint(GraphicsContext*, const IntRect& damageRect) override;
76 75
77 bool isOverlayScrollbar() const; 76 bool isOverlayScrollbar() const;
78 bool shouldParticipateInHitTesting(); 77 bool shouldParticipateInHitTesting();
79 78
80 bool gestureEvent(const PlatformGestureEvent&); 79 bool gestureEvent(const PlatformGestureEvent&);
81 80
82 // These methods are used for platform scrollbars to give :hover feedback. They will not get called
83 // when the mouse went down in a scrollbar, since it is assumed the scrollba r will start
84 // grabbing all events in that case anyway.
85 void mouseMoved(const PlatformMouseEvent&);
86 void mouseEntered(); 81 void mouseEntered();
87 void mouseExited(); 82 void mouseExited();
88 83
89 // Used by some platform scrollbars to know when they've been released from capture.
90 void mouseUp(const PlatformMouseEvent&);
91 void mouseDown(const PlatformMouseEvent&);
92
93 virtual IntRect convertToContainingView(const IntRect&) const override; 84 virtual IntRect convertToContainingView(const IntRect&) const override;
94 virtual IntRect convertFromContainingView(const IntRect&) const override; 85 virtual IntRect convertFromContainingView(const IntRect&) const override;
95 86
96 virtual IntPoint convertToContainingView(const IntPoint&) const override; 87 virtual IntPoint convertToContainingView(const IntPoint&) const override;
97 virtual IntPoint convertFromContainingView(const IntPoint&) const override; 88 virtual IntPoint convertFromContainingView(const IntPoint&) const override;
98 89
99 void moveThumb(int pos); 90 void moveThumb(int pos);
100 91
101 static int scrollbarThickness(); 92 static int scrollbarThickness();
102 93
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 virtual bool isScrollbar() const override { return true; } 146 virtual bool isScrollbar() const override { return true; }
156 147
157 float scrollableAreaCurrentPos() const; 148 float scrollableAreaCurrentPos() const;
158 }; 149 };
159 150
160 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar()); 151 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar());
161 152
162 } // namespace blink 153 } // namespace blink
163 154
164 #endif // SKY_ENGINE_PLATFORM_SCROLL_SCROLLBAR_H_ 155 #endif // SKY_ENGINE_PLATFORM_SCROLL_SCROLLBAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698