OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 namespace blink { | 49 namespace blink { |
50 | 50 |
51 class WebExternalPopupMenu; | 51 class WebExternalPopupMenu; |
52 class WebViewImpl; | 52 class WebViewImpl; |
53 struct WebPopupMenuInfo; | 53 struct WebPopupMenuInfo; |
54 class WebMouseEvent; | 54 class WebMouseEvent; |
55 | 55 |
56 // The ExternalPopupMenu connects the actual implementation of the popup menu | 56 // The ExternalPopupMenu connects the actual implementation of the popup menu |
57 // to the WebCore popup menu. | 57 // to the WebCore popup menu. |
58 class ExternalPopupMenu : public WebCore::PopupMenu, | 58 class ExternalPopupMenu FINAL : public WebCore::PopupMenu, public WebExternalPop
upMenuClient { |
59 public WebExternalPopupMenuClient { | |
60 public: | 59 public: |
61 ExternalPopupMenu(WebCore::Frame&, WebCore::PopupMenuClient*, WebViewImpl&); | 60 ExternalPopupMenu(WebCore::Frame&, WebCore::PopupMenuClient*, WebViewImpl&); |
62 virtual ~ExternalPopupMenu(); | 61 virtual ~ExternalPopupMenu(); |
63 | 62 |
64 private: | 63 private: |
65 // WebCore::PopupMenu methods: | 64 // WebCore::PopupMenu methods: |
66 virtual void show(const WebCore::FloatQuad& controlPosition, const WebCore::
IntSize&, int index) OVERRIDE; | 65 virtual void show(const WebCore::FloatQuad& controlPosition, const WebCore::
IntSize&, int index) OVERRIDE; |
67 virtual void hide() OVERRIDE; | 66 virtual void hide() OVERRIDE; |
68 virtual void updateFromElement() OVERRIDE; | 67 virtual void updateFromElement() OVERRIDE; |
69 virtual void disconnectClient() OVERRIDE; | 68 virtual void disconnectClient() OVERRIDE; |
70 | 69 |
71 // WebExternalPopupClient methods: | 70 // WebExternalPopupClient methods: |
72 virtual void didChangeSelection(int index); | 71 virtual void didChangeSelection(int index) OVERRIDE; |
73 virtual void didAcceptIndex(int index); | 72 virtual void didAcceptIndex(int index) OVERRIDE; |
74 virtual void didAcceptIndices(const WebVector<int>& indices); | 73 virtual void didAcceptIndices(const WebVector<int>& indices) OVERRIDE; |
75 virtual void didCancel(); | 74 virtual void didCancel() OVERRIDE; |
76 | 75 |
77 void dispatchEvent(WebCore::Timer<ExternalPopupMenu>*); | 76 void dispatchEvent(WebCore::Timer<ExternalPopupMenu>*); |
78 // Fills |info| with the popup menu information contained in the | 77 // Fills |info| with the popup menu information contained in the |
79 // WebCore::PopupMenuClient associated with this ExternalPopupMenu. | 78 // WebCore::PopupMenuClient associated with this ExternalPopupMenu. |
80 void getPopupMenuInfo(WebPopupMenuInfo* info); | 79 void getPopupMenuInfo(WebPopupMenuInfo* info); |
81 | 80 |
82 WebCore::PopupMenuClient* m_popupMenuClient; | 81 WebCore::PopupMenuClient* m_popupMenuClient; |
83 RefPtr<WebCore::FrameView> m_frameView; | 82 RefPtr<WebCore::FrameView> m_frameView; |
84 WebViewImpl& m_webView; | 83 WebViewImpl& m_webView; |
85 OwnPtr<WebMouseEvent> m_syntheticEvent; | 84 OwnPtr<WebMouseEvent> m_syntheticEvent; |
86 WebCore::Timer<ExternalPopupMenu> m_dispatchEventTimer; | 85 WebCore::Timer<ExternalPopupMenu> m_dispatchEventTimer; |
87 // The actual implementor of the show menu. | 86 // The actual implementor of the show menu. |
88 WebExternalPopupMenu* m_webExternalPopupMenu; | 87 WebExternalPopupMenu* m_webExternalPopupMenu; |
89 }; | 88 }; |
90 | 89 |
91 } // namespace blink | 90 } // namespace blink |
92 | 91 |
93 #endif // ExternalPopupMenu_h | 92 #endif // ExternalPopupMenu_h |
OLD | NEW |