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