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

Unified Diff: Source/web/PopupListBox.h

Issue 562513004: Remove FramelessScrollView. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix Windows build. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/PopupContainerClient.h ('k') | Source/web/PopupListBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupListBox.h
diff --git a/Source/web/PopupListBox.h b/Source/web/PopupListBox.h
index 4affb0ef4ec07c99223e6f087696bb503082128d..42ff009bb9e8dd6a10e9d25382dec81b49ad601a 100644
--- a/Source/web/PopupListBox.h
+++ b/Source/web/PopupListBox.h
@@ -32,7 +32,7 @@
#define PopupListBox_h
#include "core/dom/Element.h"
-#include "platform/scroll/FramelessScrollView.h"
+#include "platform/scroll/ScrollView.h"
#include "platform/text/TextDirection.h"
#include "wtf/text/WTFString.h"
@@ -46,6 +46,7 @@ class PlatformMouseEvent;
class PlatformGestureEvent;
class PlatformTouchEvent;
class PlatformWheelEvent;
+class PopupContainer;
class PopupMenuClient;
typedef unsigned long long TimeStamp;
@@ -82,31 +83,39 @@ struct PopupItem {
bool displayNone;
};
-// This class uses WebCore code to paint and handle events for a drop-down list
-// box ("combobox" on Windows).
-class PopupListBox FINAL : public FramelessScrollView, public PopupContent {
+// This class manages the scrollable content inside a <select> popup.
+class PopupListBox FINAL : public ScrollView, public PopupContent {
public:
- static PassRefPtr<PopupListBox> create(PopupMenuClient* client, bool deviceSupportsTouch)
+ static PassRefPtr<PopupListBox> create(PopupMenuClient* client, bool deviceSupportsTouch, PopupContainer* container)
{
- return adoptRef(new PopupListBox(client, deviceSupportsTouch));
+ return adoptRef(new PopupListBox(client, deviceSupportsTouch, container));
}
- // FramelessScrollView
- virtual void paint(GraphicsContext*, const IntRect&) OVERRIDE;
- virtual bool handleMouseDownEvent(const PlatformMouseEvent&) OVERRIDE;
- virtual bool handleMouseMoveEvent(const PlatformMouseEvent&) OVERRIDE;
- virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&) OVERRIDE;
- virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
- virtual bool handleKeyEvent(const PlatformKeyboardEvent&) OVERRIDE;
- virtual bool handleTouchEvent(const PlatformTouchEvent&) OVERRIDE;
- virtual bool handleGestureEvent(const PlatformGestureEvent&) OVERRIDE;
+ // Widget
+ virtual void invalidateRect(const IntRect&) OVERRIDE;
+
+ // ScrollableArea
+ virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
+ virtual bool isActive() const OVERRIDE;
+ virtual bool scrollbarsCanBeActive() const OVERRIDE;
+ virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
// ScrollView
+ virtual void paint(GraphicsContext*, const IntRect&) OVERRIDE;
virtual HostWindow* hostWindow() const OVERRIDE;
virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE;
+ virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
// PopupListBox methods
+ virtual bool handleMouseDownEvent(const PlatformMouseEvent&);
+ virtual bool handleMouseMoveEvent(const PlatformMouseEvent&);
+ virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&);
+ virtual bool handleWheelEvent(const PlatformWheelEvent&);
+ virtual bool handleKeyEvent(const PlatformKeyboardEvent&);
+ virtual bool handleTouchEvent(const PlatformTouchEvent&);
+ virtual bool handleGestureEvent(const PlatformGestureEvent&);
+
// Closes the popup
void abandon();
@@ -141,7 +150,7 @@ public:
bool isInterestedInEventForKey(int keyCode);
// Gets the height of a row.
- int getRowHeight(int index);
+ int getRowHeight(int index) const;
int getRowBaseWidth(int index);
@@ -159,16 +168,17 @@ public:
static const int defaultMaxHeight;
+protected:
+ // ScrollView
+ virtual void paintContents(GraphicsContext*, const IntRect&) OVERRIDE { }
+ virtual void scrollbarExistenceDidChange() OVERRIDE { }
+
private:
friend class PopupContainer;
friend class RefCounted<PopupListBox>;
- PopupListBox(PopupMenuClient*, bool deviceSupportsTouch);
-
- virtual ~PopupListBox()
- {
- clear();
- }
+ PopupListBox(PopupMenuClient*, bool deviceSupportsTouch, PopupContainer*);
+ virtual ~PopupListBox();
// Hides the popup. Other classes should not call this. Use abandon instead.
void hidePopup();
@@ -211,7 +221,7 @@ private:
void typeAheadFind(const PlatformKeyboardEvent&);
// Returns the font to use for the given row
- Font getRowFont(int index);
+ Font getRowFont(int index) const;
// Moves the selection down/up one item, taking care of looping back to the
// first/last element if m_loopSelectionNavigation is true.
@@ -275,6 +285,8 @@ private:
// To forward last mouse release event.
RefPtrWillBePersistent<Element> m_focusedElement;
+
+ PopupContainer* m_container;
};
} // namespace blink
« no previous file with comments | « Source/web/PopupContainerClient.h ('k') | Source/web/PopupListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698