+
/*
* Copyright (c) 2011, Google Inc. All rights reserved.
*
#ifndef PopupContainer_h
#define PopupContainer_h
-#include "PopupListBox.h"
-#include "core/platform/PopupMenuStyle.h"
-#include "core/platform/chromium/FramelessScrollView.h"
+#include "platform/PopupMenuStyle.h"
#include "platform/geometry/FloatQuad.h"
+#include "platform/scroll/FramelessScrollView.h"
+#include "web/PopupListBox.h"
-namespace WebCore {
+namespace blink {
class ChromeClient;
class FrameView;
class PopupMenuClient;
+struct WebPopupMenuInfo;
-class PopupContainer : public FramelessScrollView {
+class PopupContainer FINAL : public FramelessScrollView {
public:
- enum PopupType {
- Select, // HTML select popup.
- Suggestion, // Autocomplete/autofill popup.
- };
-
- static PassRefPtr<PopupContainer> create(PopupMenuClient*, PopupType, const PopupContainerSettings&);
+ static PassRefPtr<PopupContainer> create(PopupMenuClient*, bool deviceSupportsTouch);
// Whether a key event should be sent to this popup.
bool isInterestedInEventForKey(int keyCode);
IntRect refresh(const IntRect& targetControlRect);
// The menu per-item data.
- const WTF::Vector<PopupItem*>& popupData() const;
+ const Vector<PopupItem*>& popupData() const;
// The height of a row in the menu.
int menuItemHeight() const;
// The style of the menu being used.
PopupMenuStyle menuStyle() const;
- PopupType popupType() const { return m_popupType; }
-
// While hovering popup menu window, we want to show tool tip message.
String getSelectedItemToolTip();
private:
friend class WTF::RefCounted<PopupContainer>;
- PopupContainer(PopupMenuClient*, PopupType, const PopupContainerSettings&);
- ~PopupContainer();
+ PopupContainer(PopupMenuClient*, bool deviceSupportsTouch);
+ virtual ~PopupContainer();
// Paint the border.
void paintBorder(GraphicsContext*, const IntRect&);
void fitToListBox();
+ void popupOpened(const IntRect& bounds);
+ void getPopupMenuInfo(WebPopupMenuInfo*);
+
// Returns the ChromeClient of the page this popup is associated with.
ChromeClient& chromeClient();
RefPtr<PopupListBox> m_listBox;
RefPtr<FrameView> m_frameView;
- PopupContainerSettings m_settings;
- PopupType m_popupType;
-
// m_controlPosition contains the transformed position of the
// <select>/<input> associated with this popup. m_controlSize is the size
// of the <select>/<input> without transform.
bool m_popupOpen;
};
-} // namespace WebCore
+} // namespace blink
#endif