[email protected] | 24d2b17 | 2012-05-26 00:54:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |
6 | #define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ | ||||
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 7 | |
[email protected] | 24d2b17 | 2012-05-26 00:54:12 | [diff] [blame] | 8 | #include <vector> |
9 | |||||
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 10 | #include "base/basictypes.h" |
[email protected] | 8bd0fe6 | 2011-01-17 06:44:37 | [diff] [blame] | 11 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.h" |
12 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | ||||
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 13 | |
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 14 | namespace WebKit { |
15 | class WebExternalPopupMenuClient; | ||||
16 | } | ||||
17 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame^] | 18 | namespace content { |
19 | class RenderViewImpl; | ||||
20 | |||||
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 21 | class ExternalPopupMenu : public WebKit::WebExternalPopupMenu { |
22 | public: | ||||
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 23 | ExternalPopupMenu(RenderViewImpl* render_view, |
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 24 | const WebKit::WebPopupMenuInfo& popup_menu_info, |
25 | WebKit::WebExternalPopupMenuClient* popup_menu_client); | ||||
26 | |||||
[email protected] | 35343fe7 | 2011-06-08 02:20:21 | [diff] [blame] | 27 | virtual ~ExternalPopupMenu() {} |
28 | |||||
[email protected] | 24d2b17 | 2012-05-26 00:54:12 | [diff] [blame] | 29 | #if defined(OS_MACOSX) |
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 30 | // Called when the user has selected an item. |selected_item| is -1 if the |
31 | // user canceled the popup. | ||||
32 | void DidSelectItem(int selected_index); | ||||
[email protected] | 24d2b17 | 2012-05-26 00:54:12 | [diff] [blame] | 33 | #endif |
34 | |||||
35 | #if defined(OS_ANDROID) | ||||
36 | // Called when the user has selected items or canceled the popup. | ||||
37 | void DidSelectItems(bool canceled, const std::vector<int>& selected_indices); | ||||
38 | #endif | ||||
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 39 | |
40 | // WebKit::WebExternalPopupMenu implementation: | ||||
41 | virtual void show(const WebKit::WebRect& bounds); | ||||
42 | virtual void close(); | ||||
43 | |||||
44 | private: | ||||
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 45 | RenderViewImpl* render_view_; |
[email protected] | caf706f | 2010-10-26 17:54:08 | [diff] [blame] | 46 | WebKit::WebPopupMenuInfo popup_menu_info_; |
47 | WebKit::WebExternalPopupMenuClient* popup_menu_client_; | ||||
48 | |||||
49 | DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); | ||||
50 | }; | ||||
51 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame^] | 52 | } // namespace content |
53 | |||||
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 54 | #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |