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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class WebViewImpl; | 49 class WebViewImpl; |
50 struct WebPopupMenuInfo; | 50 struct WebPopupMenuInfo; |
51 | 51 |
52 // The ExternalPopupMenu connects the actual implementation of the popup menu | 52 // The ExternalPopupMenu connects the actual implementation of the popup menu |
53 // to the WebCore popup menu. | 53 // to the WebCore popup menu. |
54 class ExternalPopupMenu FINAL : public PopupMenu, public WebExternalPopupMenuCli
ent { | 54 class ExternalPopupMenu FINAL : public PopupMenu, public WebExternalPopupMenuCli
ent { |
55 public: | 55 public: |
56 ExternalPopupMenu(LocalFrame&, PopupMenuClient*, WebViewImpl&); | 56 ExternalPopupMenu(LocalFrame&, PopupMenuClient*, WebViewImpl&); |
57 virtual ~ExternalPopupMenu(); | 57 virtual ~ExternalPopupMenu(); |
58 | 58 |
59 | |
60 // Fills |info| with the popup menu information contained in the | 59 // Fills |info| with the popup menu information contained in the |
61 // PopupMenuClient associated with this ExternalPopupMenu. | 60 // PopupMenuClient associated with this ExternalPopupMenu. |
62 // FIXME: public only for test access. Need to revert once gtest | 61 // FIXME: public only for test access. Need to revert once gtest |
63 // helpers from chromium are available for blink. | 62 // helpers from chromium are available for blink. |
64 static void getPopupMenuInfo(WebPopupMenuInfo&, PopupMenuClient&); | 63 static void getPopupMenuInfo(WebPopupMenuInfo&, PopupMenuClient&); |
65 static int toPopupMenuItemIndex(int index, PopupMenuClient&); | 64 static int toPopupMenuItemIndex(int index, PopupMenuClient&); |
66 static int toExternalPopupMenuItemIndex(int index, PopupMenuClient&); | 65 static int toExternalPopupMenuItemIndex(int index, PopupMenuClient&); |
67 | 66 |
| 67 virtual void trace(Visitor*) OVERRIDE; |
| 68 |
68 private: | 69 private: |
69 // PopupMenu methods: | 70 // PopupMenu methods: |
70 virtual void show(const FloatQuad& controlPosition, const IntSize&, int inde
x) OVERRIDE; | 71 virtual void show(const FloatQuad& controlPosition, const IntSize&, int inde
x) OVERRIDE; |
71 virtual void hide() OVERRIDE; | 72 virtual void hide() OVERRIDE; |
72 virtual void updateFromElement() OVERRIDE; | 73 virtual void updateFromElement() OVERRIDE; |
73 virtual void disconnectClient() OVERRIDE; | 74 virtual void disconnectClient() OVERRIDE; |
74 | 75 |
75 // WebExternalPopupClient methods: | 76 // WebExternalPopupClient methods: |
76 virtual void didChangeSelection(int index) OVERRIDE; | 77 virtual void didChangeSelection(int index) OVERRIDE; |
77 virtual void didAcceptIndex(int index) OVERRIDE; | 78 virtual void didAcceptIndex(int index) OVERRIDE; |
78 virtual void didAcceptIndices(const WebVector<int>& indices) OVERRIDE; | 79 virtual void didAcceptIndices(const WebVector<int>& indices) OVERRIDE; |
79 virtual void didCancel() OVERRIDE; | 80 virtual void didCancel() OVERRIDE; |
80 | 81 |
81 void dispatchEvent(Timer<ExternalPopupMenu>*); | 82 void dispatchEvent(Timer<ExternalPopupMenu>*); |
82 | 83 |
83 PopupMenuClient* m_popupMenuClient; | 84 PopupMenuClient* m_popupMenuClient; |
84 RefPtr<LocalFrame> m_localFrame; | 85 RefPtrWillBeMember<LocalFrame> m_localFrame; |
85 WebViewImpl& m_webView; | 86 WebViewImpl& m_webView; |
86 OwnPtr<WebMouseEvent> m_syntheticEvent; | 87 OwnPtr<WebMouseEvent> m_syntheticEvent; |
87 Timer<ExternalPopupMenu> m_dispatchEventTimer; | 88 Timer<ExternalPopupMenu> m_dispatchEventTimer; |
88 // The actual implementor of the show menu. | 89 // The actual implementor of the show menu. |
89 WebExternalPopupMenu* m_webExternalPopupMenu; | 90 WebExternalPopupMenu* m_webExternalPopupMenu; |
90 }; | 91 }; |
91 | 92 |
92 } // namespace blink | 93 } // namespace blink |
93 | 94 |
94 #endif // ExternalPopupMenu_h | 95 #endif // ExternalPopupMenu_h |
OLD | NEW |