1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
6 #define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
10 #include "base/basictypes.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h"
16 class WebExternalPopupMenuClient
;
19 class ExternalPopupMenu
: public WebKit::WebExternalPopupMenu
{
21 ExternalPopupMenu(RenderViewImpl
* render_view
,
22 const WebKit::WebPopupMenuInfo
& popup_menu_info
,
23 WebKit::WebExternalPopupMenuClient
* popup_menu_client
);
25 virtual ~ExternalPopupMenu() {}
27 #if defined(OS_MACOSX)
28 // Called when the user has selected an item. |selected_item| is -1 if the
29 // user canceled the popup.
30 void DidSelectItem(int selected_index
);
33 #if defined(OS_ANDROID)
34 // Called when the user has selected items or canceled the popup.
35 void DidSelectItems(bool canceled
, const std::vector
<int>& selected_indices
);
38 // WebKit::WebExternalPopupMenu implementation:
39 virtual void show(const WebKit::WebRect
& bounds
);
43 RenderViewImpl
* render_view_
;
44 WebKit::WebPopupMenuInfo popup_menu_info_
;
45 WebKit::WebExternalPopupMenuClient
* popup_menu_client_
;
47 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu
);
50 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_