| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "platform/PopupMenuStyle.h" | 35 #include "platform/PopupMenuStyle.h" |
| 36 #include "platform/geometry/FloatQuad.h" | 36 #include "platform/geometry/FloatQuad.h" |
| 37 #include "platform/scroll/FramelessScrollView.h" | 37 #include "platform/scroll/FramelessScrollView.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class ChromeClient; | 41 class ChromeClient; |
| 42 class FrameView; | 42 class FrameView; |
| 43 class PopupMenuClient; | 43 class PopupMenuClient; |
| 44 | 44 |
| 45 class PopupContainer : public FramelessScrollView { | 45 class PopupContainer FINAL : public FramelessScrollView { |
| 46 public: | 46 public: |
| 47 enum PopupType { | 47 enum PopupType { |
| 48 Select, // HTML select popup. | 48 Select, // HTML select popup. |
| 49 Suggestion, // Autocomplete/autofill popup. | 49 Suggestion, // Autocomplete/autofill popup. |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 static PassRefPtr<PopupContainer> create(PopupMenuClient*, PopupType, bool d
eviceSupportsTouch); | 52 static PassRefPtr<PopupContainer> create(PopupMenuClient*, PopupType, bool d
eviceSupportsTouch); |
| 53 | 53 |
| 54 // Whether a key event should be sent to this popup. | 54 // Whether a key event should be sent to this popup. |
| 55 bool isInterestedInEventForKey(int keyCode); | 55 bool isInterestedInEventForKey(int keyCode); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // While hovering popup menu window, we want to show tool tip message. | 111 // While hovering popup menu window, we want to show tool tip message. |
| 112 String getSelectedItemToolTip(); | 112 String getSelectedItemToolTip(); |
| 113 | 113 |
| 114 // This is public for testing. | 114 // This is public for testing. |
| 115 static IntRect layoutAndCalculateWidgetRectInternal(IntRect widgetRectInScre
en, int targetControlHeight, const FloatRect& windowRect, const FloatRect& scree
n, bool isRTL, const int rtlOffset, const int verticalOffset, const IntSize& tra
nsformOffset, PopupContent*, bool& needToResizeView); | 115 static IntRect layoutAndCalculateWidgetRectInternal(IntRect widgetRectInScre
en, int targetControlHeight, const FloatRect& windowRect, const FloatRect& scree
n, bool isRTL, const int rtlOffset, const int verticalOffset, const IntSize& tra
nsformOffset, PopupContent*, bool& needToResizeView); |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 friend class WTF::RefCounted<PopupContainer>; | 118 friend class WTF::RefCounted<PopupContainer>; |
| 119 | 119 |
| 120 PopupContainer(PopupMenuClient*, PopupType, bool deviceSupportsTouch); | 120 PopupContainer(PopupMenuClient*, PopupType, bool deviceSupportsTouch); |
| 121 ~PopupContainer(); | 121 virtual ~PopupContainer(); |
| 122 | 122 |
| 123 // Paint the border. | 123 // Paint the border. |
| 124 void paintBorder(GraphicsContext*, const IntRect&); | 124 void paintBorder(GraphicsContext*, const IntRect&); |
| 125 | 125 |
| 126 // Layout and calculate popup widget size and location and returns it as Int
Rect. | 126 // Layout and calculate popup widget size and location and returns it as Int
Rect. |
| 127 IntRect layoutAndCalculateWidgetRect(int targetControlHeight, const IntSize&
transformOffset, const IntPoint& popupInitialCoordinate); | 127 IntRect layoutAndCalculateWidgetRect(int targetControlHeight, const IntSize&
transformOffset, const IntPoint& popupInitialCoordinate); |
| 128 | 128 |
| 129 void fitToListBox(); | 129 void fitToListBox(); |
| 130 | 130 |
| 131 // Returns the ChromeClient of the page this popup is associated with. | 131 // Returns the ChromeClient of the page this popup is associated with. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 151 FloatQuad m_controlPosition; | 151 FloatQuad m_controlPosition; |
| 152 IntSize m_controlSize; | 152 IntSize m_controlSize; |
| 153 | 153 |
| 154 // Whether the popup is currently open. | 154 // Whether the popup is currently open. |
| 155 bool m_popupOpen; | 155 bool m_popupOpen; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace WebCore | 158 } // namespace WebCore |
| 159 | 159 |
| 160 #endif | 160 #endif |
| OLD | NEW |