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/public/web/WebExternalPopupMenu.h"
12 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h"
15 class WebExternalPopupMenuClient
;
21 class ExternalPopupMenu
: public WebKit::WebExternalPopupMenu
{
23 ExternalPopupMenu(RenderViewImpl
* render_view
,
24 const WebKit::WebPopupMenuInfo
& popup_menu_info
,
25 WebKit::WebExternalPopupMenuClient
* popup_menu_client
);
27 virtual ~ExternalPopupMenu() {}
29 #if defined(OS_MACOSX)
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
);
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
);
40 // WebKit::WebExternalPopupMenu implementation:
41 virtual void show(const WebKit::WebRect
& bounds
);
45 RenderViewImpl
* render_view_
;
46 WebKit::WebPopupMenuInfo popup_menu_info_
;
47 WebKit::WebExternalPopupMenuClient
* popup_menu_client_
;
49 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu
);
52 } // namespace content
54 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_