OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebPopupMenuImpl_h | 31 #ifndef WebPopupMenuImpl_h |
32 #define WebPopupMenuImpl_h | 32 #define WebPopupMenuImpl_h |
33 | 33 |
34 #include "WebPopupMenu.h" | 34 #include "WebPopupMenu.h" |
35 #include "platform/scroll/FramelessScrollViewClient.h" | 35 #include "platform/scroll/FramelessScrollViewClient.h" |
| 36 #include "public/platform/WebContentLayerClient.h" |
36 #include "public/platform/WebPoint.h" | 37 #include "public/platform/WebPoint.h" |
37 #include "public/platform/WebSize.h" | 38 #include "public/platform/WebSize.h" |
38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
39 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
40 | 41 |
41 namespace WebCore { | 42 namespace WebCore { |
42 class Frame; | 43 class Frame; |
43 class FramelessScrollView; | 44 class FramelessScrollView; |
44 class KeyboardEvent; | 45 class KeyboardEvent; |
45 class Page; | 46 class Page; |
46 class PlatformKeyboardEvent; | 47 class PlatformKeyboardEvent; |
47 class Range; | 48 class Range; |
48 class Widget; | 49 class Widget; |
49 } | 50 } |
50 | 51 |
51 namespace blink { | 52 namespace blink { |
| 53 class WebContentLayer; |
52 class WebGestureEvent; | 54 class WebGestureEvent; |
53 class WebKeyboardEvent; | 55 class WebKeyboardEvent; |
| 56 class WebLayerTreeView; |
54 class WebMouseEvent; | 57 class WebMouseEvent; |
55 class WebMouseWheelEvent; | 58 class WebMouseWheelEvent; |
56 class WebRange; | 59 class WebRange; |
57 struct WebRect; | 60 struct WebRect; |
58 class WebTouchEvent; | 61 class WebTouchEvent; |
59 | 62 |
60 class WebPopupMenuImpl : public WebPopupMenu, | 63 class WebPopupMenuImpl : public WebPopupMenu, public WebCore::FramelessScrollVie
wClient, public WebContentLayerClient, public RefCounted<WebPopupMenuImpl> { |
61 public WebCore::FramelessScrollViewClient, | |
62 public RefCounted<WebPopupMenuImpl> { | |
63 WTF_MAKE_FAST_ALLOCATED; | 64 WTF_MAKE_FAST_ALLOCATED; |
64 public: | 65 public: |
65 // WebWidget functions: | 66 // WebWidget functions: |
66 virtual void close() OVERRIDE FINAL; | 67 virtual void close() OVERRIDE FINAL; |
67 virtual WebSize size() OVERRIDE FINAL { return m_size; } | 68 virtual WebSize size() OVERRIDE FINAL { return m_size; } |
68 virtual void willStartLiveResize() OVERRIDE FINAL; | 69 virtual void willStartLiveResize() OVERRIDE FINAL; |
69 virtual void resize(const WebSize&) OVERRIDE FINAL; | 70 virtual void resize(const WebSize&) OVERRIDE FINAL; |
70 virtual void willEndLiveResize() OVERRIDE FINAL; | 71 virtual void willEndLiveResize() OVERRIDE FINAL; |
71 virtual void animate(double frameBeginTime) OVERRIDE FINAL; | 72 virtual void animate(double frameBeginTime) OVERRIDE FINAL; |
72 virtual void layout() OVERRIDE FINAL; | 73 virtual void layout() OVERRIDE FINAL; |
| 74 virtual void enterForceCompositingMode(bool enable) OVERRIDE FINAL; |
| 75 virtual void didExitCompositingMode() OVERRIDE FINAL; |
73 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo
mpositorIfAvailable) OVERRIDE FINAL; | 76 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo
mpositorIfAvailable) OVERRIDE FINAL; |
74 virtual void themeChanged() OVERRIDE FINAL; | 77 virtual void themeChanged() OVERRIDE FINAL; |
75 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE FINAL; | 78 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE FINAL; |
76 virtual void mouseCaptureLost() OVERRIDE FINAL; | 79 virtual void mouseCaptureLost() OVERRIDE FINAL; |
77 virtual void setFocus(bool enable) OVERRIDE FINAL; | 80 virtual void setFocus(bool enable) OVERRIDE FINAL; |
78 virtual bool setComposition( | 81 virtual bool setComposition( |
79 const WebString& text, | 82 const WebString& text, |
80 const WebVector<WebCompositionUnderline>& underlines, | 83 const WebVector<WebCompositionUnderline>& underlines, |
81 int selectionStart, int selectionEnd) OVERRIDE FINAL; | 84 int selectionStart, int selectionEnd) OVERRIDE FINAL; |
82 virtual bool confirmComposition() OVERRIDE FINAL; | 85 virtual bool confirmComposition() OVERRIDE FINAL; |
83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) OVERRIDE FINAL; | 86 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) OVERRIDE FINAL; |
84 virtual bool confirmComposition(const WebString& text) OVERRIDE FINAL; | 87 virtual bool confirmComposition(const WebString& text) OVERRIDE FINAL; |
85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE FIN
AL; | 88 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE FIN
AL; |
86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID
E FINAL; | 89 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID
E FINAL; |
87 virtual void setTextDirection(WebTextDirection) OVERRIDE FINAL; | 90 virtual void setTextDirection(WebTextDirection) OVERRIDE FINAL; |
88 virtual bool isAcceleratedCompositingActive() const OVERRIDE FINAL { return
false; } | 91 virtual bool isAcceleratedCompositingActive() const OVERRIDE FINAL { return
false; } |
89 virtual bool isPopupMenu() const OVERRIDE FINAL { return true; } | 92 virtual bool isPopupMenu() const OVERRIDE FINAL { return true; } |
| 93 virtual void willCloseLayerTreeView() OVERRIDE FINAL; |
| 94 |
| 95 // WebContentLayerClient |
| 96 virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCD
Test, WebFloatRect& opaque) OVERRIDE FINAL; |
90 | 97 |
91 // WebPopupMenuImpl | 98 // WebPopupMenuImpl |
92 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds)
; | 99 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds)
; |
93 | 100 |
94 WebWidgetClient* client() { return m_client; } | 101 WebWidgetClient* client() { return m_client; } |
95 | 102 |
96 void handleMouseMove(const WebMouseEvent&); | 103 void handleMouseMove(const WebMouseEvent&); |
97 void handleMouseLeave(const WebMouseEvent&); | 104 void handleMouseLeave(const WebMouseEvent&); |
98 void handleMouseDown(const WebMouseEvent&); | 105 void handleMouseDown(const WebMouseEvent&); |
99 void handleMouseUp(const WebMouseEvent&); | 106 void handleMouseUp(const WebMouseEvent&); |
(...skipping 20 matching lines...) Expand all Loading... |
120 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O
VERRIDE FINAL; | 127 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O
VERRIDE FINAL; |
121 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE
RRIDE FINAL; | 128 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE
RRIDE FINAL; |
122 virtual WebScreenInfo screenInfo() const OVERRIDE FINAL; | 129 virtual WebScreenInfo screenInfo() const OVERRIDE FINAL; |
123 | 130 |
124 // WebCore::FramelessScrollViewClient methods: | 131 // WebCore::FramelessScrollViewClient methods: |
125 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE FINAL; | 132 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE FINAL; |
126 | 133 |
127 WebWidgetClient* m_client; | 134 WebWidgetClient* m_client; |
128 WebSize m_size; | 135 WebSize m_size; |
129 | 136 |
| 137 WebLayerTreeView* m_layerTreeView; |
| 138 OwnPtr<WebContentLayer> m_rootLayer; |
| 139 bool m_isAcceleratedCompositingActive; |
| 140 |
130 WebPoint m_lastMousePosition; | 141 WebPoint m_lastMousePosition; |
131 | 142 |
132 // This is a non-owning ref. The popup will notify us via popupClosed() | 143 // This is a non-owning ref. The popup will notify us via popupClosed() |
133 // before it is destroyed. | 144 // before it is destroyed. |
134 WebCore::FramelessScrollView* m_widget; | 145 WebCore::FramelessScrollView* m_widget; |
135 }; | 146 }; |
136 | 147 |
137 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi
dget.isPopupMenu()); | 148 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi
dget.isPopupMenu()); |
138 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so | 149 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so |
139 // no need for further checking. | 150 // no need for further checking. |
140 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client,
true, true); | 151 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client,
true, true); |
141 | 152 |
142 } // namespace blink | 153 } // namespace blink |
143 | 154 |
144 #endif | 155 #endif |
OLD | NEW |