blob: d701ddc832f9dc25e0978b7129946c292c470909 [file] [log] [blame]
[email protected]24d2b172012-05-26 00:54:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]caf706f2010-10-26 17:54:082// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]55722152011-03-22 01:33:535#ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
6#define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
[email protected]caf706f2010-10-26 17:54:087
[email protected]24d2b172012-05-26 00:54:128#include <vector>
9
[email protected]caf706f2010-10-26 17:54:0810#include "base/basictypes.h"
[email protected]8bd0fe62011-01-17 06:44:3711#include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.h"
12#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h"
[email protected]caf706f2010-10-26 17:54:0813
[email protected]caf706f2010-10-26 17:54:0814namespace WebKit {
15class WebExternalPopupMenuClient;
16}
17
[email protected]e9ff79c2012-10-19 21:31:2618namespace content {
19class RenderViewImpl;
20
[email protected]caf706f2010-10-26 17:54:0821class ExternalPopupMenu : public WebKit::WebExternalPopupMenu {
22 public:
[email protected]310ebd6302011-10-10 19:06:2823 ExternalPopupMenu(RenderViewImpl* render_view,
[email protected]caf706f2010-10-26 17:54:0824 const WebKit::WebPopupMenuInfo& popup_menu_info,
25 WebKit::WebExternalPopupMenuClient* popup_menu_client);
26
[email protected]35343fe72011-06-08 02:20:2127 virtual ~ExternalPopupMenu() {}
28
[email protected]24d2b172012-05-26 00:54:1229#if defined(OS_MACOSX)
[email protected]caf706f2010-10-26 17:54:0830 // 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]24d2b172012-05-26 00:54:1233#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]caf706f2010-10-26 17:54:0839
40 // WebKit::WebExternalPopupMenu implementation:
41 virtual void show(const WebKit::WebRect& bounds);
42 virtual void close();
43
44 private:
[email protected]310ebd6302011-10-10 19:06:2845 RenderViewImpl* render_view_;
[email protected]caf706f2010-10-26 17:54:0846 WebKit::WebPopupMenuInfo popup_menu_info_;
47 WebKit::WebExternalPopupMenuClient* popup_menu_client_;
48
49 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu);
50};
51
[email protected]e9ff79c2012-10-19 21:31:2652} // namespace content
53
[email protected]55722152011-03-22 01:33:5354#endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_