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 28 matching lines...) Expand all Loading... |
39 #include "public/platform/WebScrollbar.h" | 39 #include "public/platform/WebScrollbar.h" |
40 #include "public/web/WebExternalPopupMenuClient.h" | 40 #include "public/web/WebExternalPopupMenuClient.h" |
41 #include "web/WebExport.h" | 41 #include "web/WebExport.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class HTMLSelectElement; | 45 class HTMLSelectElement; |
46 class LocalFrame; | 46 class LocalFrame; |
47 class WebExternalPopupMenu; | 47 class WebExternalPopupMenu; |
48 class WebMouseEvent; | 48 class WebMouseEvent; |
49 class WebViewImpl; | 49 class WebView; |
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 WEB_EXPORT ExternalPopupMenu final : NON_EXPORTED_BASE(public PopupMenu), | 54 class WEB_EXPORT ExternalPopupMenu final : NON_EXPORTED_BASE(public PopupMenu), |
55 public WebExternalPopupMenuClient { | 55 public WebExternalPopupMenuClient { |
56 public: | 56 public: |
57 ExternalPopupMenu(LocalFrame&, HTMLSelectElement&, WebViewImpl&); | 57 ExternalPopupMenu(LocalFrame&, HTMLSelectElement&, WebView&); |
58 ~ExternalPopupMenu() override; | 58 ~ExternalPopupMenu() override; |
59 | 59 |
60 // Fills |info| with the popup menu information contained in the | 60 // Fills |info| with the popup menu information contained in the |
61 // PopupMenuClient associated with this ExternalPopupMenu. | 61 // PopupMenuClient associated with this ExternalPopupMenu. |
62 // FIXME: public only for test access. Need to revert once gtest | 62 // FIXME: public only for test access. Need to revert once gtest |
63 // helpers from chromium are available for blink. | 63 // helpers from chromium are available for blink. |
64 static void GetPopupMenuInfo(WebPopupMenuInfo&, HTMLSelectElement&); | 64 static void GetPopupMenuInfo(WebPopupMenuInfo&, HTMLSelectElement&); |
65 static int ToPopupMenuItemIndex(int index, HTMLSelectElement&); | 65 static int ToPopupMenuItemIndex(int index, HTMLSelectElement&); |
66 static int ToExternalPopupMenuItemIndex(int index, HTMLSelectElement&); | 66 static int ToExternalPopupMenuItemIndex(int index, HTMLSelectElement&); |
67 | 67 |
(...skipping 11 matching lines...) Expand all Loading... |
79 void DidAcceptIndex(int index) override; | 79 void DidAcceptIndex(int index) override; |
80 void DidAcceptIndices(const WebVector<int>& indices) override; | 80 void DidAcceptIndices(const WebVector<int>& indices) override; |
81 void DidCancel() override; | 81 void DidCancel() override; |
82 | 82 |
83 bool ShowInternal(); | 83 bool ShowInternal(); |
84 void DispatchEvent(TimerBase*); | 84 void DispatchEvent(TimerBase*); |
85 void Update(); | 85 void Update(); |
86 | 86 |
87 Member<HTMLSelectElement> owner_element_; | 87 Member<HTMLSelectElement> owner_element_; |
88 Member<LocalFrame> local_frame_; | 88 Member<LocalFrame> local_frame_; |
89 WebViewImpl& web_view_; | 89 WebView& web_view_; |
90 std::unique_ptr<WebMouseEvent> synthetic_event_; | 90 std::unique_ptr<WebMouseEvent> synthetic_event_; |
91 TaskRunnerTimer<ExternalPopupMenu> dispatch_event_timer_; | 91 TaskRunnerTimer<ExternalPopupMenu> dispatch_event_timer_; |
92 // The actual implementor of the show menu. | 92 // The actual implementor of the show menu. |
93 WebExternalPopupMenu* web_external_popup_menu_; | 93 WebExternalPopupMenu* web_external_popup_menu_; |
94 bool needs_update_ = false; | 94 bool needs_update_ = false; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // ExternalPopupMenu_h | 99 #endif // ExternalPopupMenu_h |
OLD | NEW |