OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ |
6 #define WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | |
9 #include "base/ref_counted.h" | |
10 #include "webkit/api/public/WebPoint.h" | 8 #include "webkit/api/public/WebPoint.h" |
11 #include "webkit/api/public/WebPopupMenu.h" | 9 #include "webkit/api/public/WebPopupMenu.h" |
12 #include "webkit/api/public/WebSize.h" | 10 #include "webkit/api/public/WebSize.h" |
13 | 11 |
14 #include "FramelessScrollViewClient.h" | 12 #include "FramelessScrollViewClient.h" |
| 13 #include <wtf/RefCounted.h> |
15 | 14 |
16 namespace WebCore { | 15 namespace WebCore { |
17 class Frame; | 16 class Frame; |
18 class FramelessScrollView; | 17 class FramelessScrollView; |
19 class KeyboardEvent; | 18 class KeyboardEvent; |
20 class Page; | 19 class Page; |
21 class PlatformKeyboardEvent; | 20 class PlatformKeyboardEvent; |
22 class Range; | 21 class Range; |
23 class Widget; | 22 class Widget; |
24 } | 23 } |
25 | 24 |
26 namespace WebKit { | 25 namespace WebKit { |
27 class WebKeyboardEvent; | 26 class WebKeyboardEvent; |
28 class WebMouseEvent; | 27 class WebMouseEvent; |
29 class WebMouseWheelEvent; | 28 class WebMouseWheelEvent; |
30 struct WebRect; | 29 struct WebRect; |
31 } | 30 } |
32 | 31 |
33 struct MenuItem; | 32 struct MenuItem; |
34 | 33 |
35 class WebPopupMenuImpl : public WebKit::WebPopupMenu, | 34 class WebPopupMenuImpl : public WebKit::WebPopupMenu, |
36 public WebCore::FramelessScrollViewClient, | 35 public WebCore::FramelessScrollViewClient, |
37 public base::RefCounted<WebPopupMenuImpl> { | 36 public RefCounted<WebPopupMenuImpl> { |
38 public: | 37 public: |
39 // WebWidget | 38 // WebWidget |
40 virtual void close(); | 39 virtual void close(); |
41 virtual WebKit::WebSize size() { return size_; } | 40 virtual WebKit::WebSize size() { return size_; } |
42 virtual void resize(const WebKit::WebSize& new_size); | 41 virtual void resize(const WebKit::WebSize& new_size); |
43 virtual void layout(); | 42 virtual void layout(); |
44 virtual void paint(WebKit::WebCanvas* canvas, | 43 virtual void paint(WebKit::WebCanvas* canvas, |
45 const WebKit::WebRect& rect); | 44 const WebKit::WebRect& rect); |
46 virtual bool handleInputEvent(const WebKit::WebInputEvent& input_event); | 45 virtual bool handleInputEvent(const WebKit::WebInputEvent& input_event); |
47 virtual void mouseCaptureLost(); | 46 virtual void mouseCaptureLost(); |
(...skipping 18 matching lines...) Expand all Loading... |
66 void MouseMove(const WebKit::WebMouseEvent& mouse_event); | 65 void MouseMove(const WebKit::WebMouseEvent& mouse_event); |
67 void MouseLeave(const WebKit::WebMouseEvent& mouse_event); | 66 void MouseLeave(const WebKit::WebMouseEvent& mouse_event); |
68 void MouseDown(const WebKit::WebMouseEvent& mouse_event); | 67 void MouseDown(const WebKit::WebMouseEvent& mouse_event); |
69 void MouseUp(const WebKit::WebMouseEvent& mouse_event); | 68 void MouseUp(const WebKit::WebMouseEvent& mouse_event); |
70 void MouseDoubleClick(const WebKit::WebMouseEvent& mouse_event); | 69 void MouseDoubleClick(const WebKit::WebMouseEvent& mouse_event); |
71 void MouseWheel(const WebKit::WebMouseWheelEvent& wheel_event); | 70 void MouseWheel(const WebKit::WebMouseWheelEvent& wheel_event); |
72 bool KeyEvent(const WebKit::WebKeyboardEvent& key_event); | 71 bool KeyEvent(const WebKit::WebKeyboardEvent& key_event); |
73 | 72 |
74 protected: | 73 protected: |
75 friend class WebKit::WebPopupMenu; // For WebPopupMenu::create | 74 friend class WebKit::WebPopupMenu; // For WebPopupMenu::create |
76 friend class base::RefCounted<WebPopupMenuImpl>; | 75 friend class WTF::RefCounted<WebPopupMenuImpl>; |
77 | 76 |
78 WebPopupMenuImpl(WebKit::WebWidgetClient* client); | 77 WebPopupMenuImpl(WebKit::WebWidgetClient* client); |
79 ~WebPopupMenuImpl(); | 78 ~WebPopupMenuImpl(); |
80 | 79 |
81 // WebCore::HostWindow methods: | 80 // WebCore::HostWindow methods: |
82 virtual void repaint(const WebCore::IntRect&, | 81 virtual void repaint(const WebCore::IntRect&, |
83 bool content_changed, | 82 bool content_changed, |
84 bool immediate = false, | 83 bool immediate = false, |
85 bool repaint_content_only = false); | 84 bool repaint_content_only = false); |
86 virtual void scroll(const WebCore::IntSize& scroll_delta, | 85 virtual void scroll(const WebCore::IntSize& scroll_delta, |
(...skipping 10 matching lines...) Expand all Loading... |
97 virtual void popupClosed(WebCore::FramelessScrollView* popup_view); | 96 virtual void popupClosed(WebCore::FramelessScrollView* popup_view); |
98 | 97 |
99 WebKit::WebWidgetClient* client_; | 98 WebKit::WebWidgetClient* client_; |
100 WebKit::WebSize size_; | 99 WebKit::WebSize size_; |
101 | 100 |
102 WebKit::WebPoint last_mouse_position_; | 101 WebKit::WebPoint last_mouse_position_; |
103 | 102 |
104 // This is a non-owning ref. The popup will notify us via popupClosed() | 103 // This is a non-owning ref. The popup will notify us via popupClosed() |
105 // before it is destroyed. | 104 // before it is destroyed. |
106 WebCore::FramelessScrollView* widget_; | 105 WebCore::FramelessScrollView* widget_; |
107 | |
108 private: | |
109 DISALLOW_COPY_AND_ASSIGN(WebPopupMenuImpl); | |
110 }; | 106 }; |
111 | 107 |
112 #endif // WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ | 108 #endif // WEBKIT_GLUE_WEBPOPUPMENU_IMPL_H_ |
OLD | NEW |