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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class WebRange; | 56 class WebRange; |
57 struct WebRect; | 57 struct WebRect; |
58 class WebTouchEvent; | 58 class WebTouchEvent; |
59 | 59 |
60 class WebPopupMenuImpl : public WebPopupMenu, | 60 class WebPopupMenuImpl : public WebPopupMenu, |
61 public WebCore::FramelessScrollViewClient, | 61 public WebCore::FramelessScrollViewClient, |
62 public RefCounted<WebPopupMenuImpl> { | 62 public RefCounted<WebPopupMenuImpl> { |
63 WTF_MAKE_FAST_ALLOCATED; | 63 WTF_MAKE_FAST_ALLOCATED; |
64 public: | 64 public: |
65 // WebWidget functions: | 65 // WebWidget functions: |
66 virtual void close() OVERRIDE; | 66 virtual void close() OVERRIDE FINAL; |
67 virtual WebSize size() OVERRIDE { return m_size; } | 67 virtual WebSize size() OVERRIDE FINAL { return m_size; } |
68 virtual void willStartLiveResize() OVERRIDE; | 68 virtual void willStartLiveResize() OVERRIDE FINAL; |
69 virtual void resize(const WebSize&) OVERRIDE; | 69 virtual void resize(const WebSize&) OVERRIDE FINAL; |
70 virtual void willEndLiveResize() OVERRIDE; | 70 virtual void willEndLiveResize() OVERRIDE FINAL; |
71 virtual void animate(double frameBeginTime) OVERRIDE; | 71 virtual void animate(double frameBeginTime) OVERRIDE FINAL; |
72 virtual void layout() OVERRIDE; | 72 virtual void layout() OVERRIDE FINAL; |
73 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo
mpositorIfAvailable) OVERRIDE; | 73 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo
mpositorIfAvailable) OVERRIDE FINAL; |
74 virtual void themeChanged() OVERRIDE; | 74 virtual void themeChanged() OVERRIDE FINAL; |
75 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; | 75 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE FINAL; |
76 virtual void mouseCaptureLost() OVERRIDE; | 76 virtual void mouseCaptureLost() OVERRIDE FINAL; |
77 virtual void setFocus(bool enable) OVERRIDE; | 77 virtual void setFocus(bool enable) OVERRIDE FINAL; |
78 virtual bool setComposition( | 78 virtual bool setComposition( |
79 const WebString& text, | 79 const WebString& text, |
80 const WebVector<WebCompositionUnderline>& underlines, | 80 const WebVector<WebCompositionUnderline>& underlines, |
81 int selectionStart, int selectionEnd) OVERRIDE; | 81 int selectionStart, int selectionEnd) OVERRIDE FINAL; |
82 virtual bool confirmComposition() OVERRIDE; | 82 virtual bool confirmComposition() OVERRIDE FINAL; |
83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) OVERRIDE; | 83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) OVERRIDE FINAL; |
84 virtual bool confirmComposition(const WebString& text) OVERRIDE; | 84 virtual bool confirmComposition(const WebString& text) OVERRIDE FINAL; |
85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE; | 85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE FIN
AL; |
86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID
E; | 86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID
E FINAL; |
87 virtual void setTextDirection(WebTextDirection) OVERRIDE; | 87 virtual void setTextDirection(WebTextDirection) OVERRIDE FINAL; |
88 virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false;
} | 88 virtual bool isAcceleratedCompositingActive() const OVERRIDE FINAL { return
false; } |
89 virtual bool isPopupMenu() const OVERRIDE { return true; } | 89 virtual bool isPopupMenu() const OVERRIDE FINAL { return true; } |
90 | 90 |
91 // WebPopupMenuImpl | 91 // WebPopupMenuImpl |
92 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds)
; | 92 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds)
; |
93 | 93 |
94 WebWidgetClient* client() { return m_client; } | 94 WebWidgetClient* client() { return m_client; } |
95 | 95 |
96 void handleMouseMove(const WebMouseEvent&); | 96 void handleMouseMove(const WebMouseEvent&); |
97 void handleMouseLeave(const WebMouseEvent&); | 97 void handleMouseLeave(const WebMouseEvent&); |
98 void handleMouseDown(const WebMouseEvent&); | 98 void handleMouseDown(const WebMouseEvent&); |
99 void handleMouseUp(const WebMouseEvent&); | 99 void handleMouseUp(const WebMouseEvent&); |
100 void handleMouseDoubleClick(const WebMouseEvent&); | 100 void handleMouseDoubleClick(const WebMouseEvent&); |
101 void handleMouseWheel(const WebMouseWheelEvent&); | 101 void handleMouseWheel(const WebMouseWheelEvent&); |
102 bool handleGestureEvent(const WebGestureEvent&); | 102 bool handleGestureEvent(const WebGestureEvent&); |
103 bool handleTouchEvent(const WebTouchEvent&); | 103 bool handleTouchEvent(const WebTouchEvent&); |
104 bool handleKeyEvent(const WebKeyboardEvent&); | 104 bool handleKeyEvent(const WebKeyboardEvent&); |
105 | 105 |
106 protected: | 106 protected: |
107 friend class WebPopupMenu; // For WebPopupMenu::create. | 107 friend class WebPopupMenu; // For WebPopupMenu::create. |
108 friend class WTF::RefCounted<WebPopupMenuImpl>; | 108 friend class WTF::RefCounted<WebPopupMenuImpl>; |
109 | 109 |
110 WebPopupMenuImpl(WebWidgetClient*); | 110 WebPopupMenuImpl(WebWidgetClient*); |
111 ~WebPopupMenuImpl(); | 111 ~WebPopupMenuImpl(); |
112 | 112 |
113 // WebCore::HostWindow methods: | 113 // WebCore::HostWindow methods: |
114 virtual void invalidateContentsAndRootView(const WebCore::IntRect&) OVERRIDE
; | 114 virtual void invalidateContentsAndRootView(const WebCore::IntRect&) OVERRIDE
FINAL; |
115 virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&) OVERRI
DE; | 115 virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&) OVERRI
DE FINAL; |
116 virtual void scheduleAnimation() OVERRIDE; | 116 virtual void scheduleAnimation() OVERRIDE FINAL; |
117 virtual void scroll( | 117 virtual void scroll( |
118 const WebCore::IntSize& scrollDelta, const WebCore::IntRect& scrollRect, | 118 const WebCore::IntSize& scrollDelta, const WebCore::IntRect& scrollRect, |
119 const WebCore::IntRect& clipRect) OVERRIDE; | 119 const WebCore::IntRect& clipRect) OVERRIDE FINAL; |
120 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O
VERRIDE; | 120 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O
VERRIDE FINAL; |
121 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE
RRIDE; | 121 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE
RRIDE FINAL; |
122 virtual WebScreenInfo screenInfo() const OVERRIDE; | 122 virtual WebScreenInfo screenInfo() const OVERRIDE FINAL; |
123 | 123 |
124 // WebCore::FramelessScrollViewClient methods: | 124 // WebCore::FramelessScrollViewClient methods: |
125 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE; | 125 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE FINAL; |
126 | 126 |
127 WebWidgetClient* m_client; | 127 WebWidgetClient* m_client; |
128 WebSize m_size; | 128 WebSize m_size; |
129 | 129 |
130 WebPoint m_lastMousePosition; | 130 WebPoint m_lastMousePosition; |
131 | 131 |
132 // This is a non-owning ref. The popup will notify us via popupClosed() | 132 // This is a non-owning ref. The popup will notify us via popupClosed() |
133 // before it is destroyed. | 133 // before it is destroyed. |
134 WebCore::FramelessScrollView* m_widget; | 134 WebCore::FramelessScrollView* m_widget; |
135 }; | 135 }; |
136 | 136 |
137 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi
dget.isPopupMenu()); | 137 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi
dget.isPopupMenu()); |
138 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so | 138 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so |
139 // no need for further checking. | 139 // no need for further checking. |
140 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client,
true, true); | 140 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client,
true, true); |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
143 | 143 |
144 #endif | 144 #endif |
OLD | NEW |