Update function names in BrowserContextKeyedServiceFactory::GetServiceForBrowserConte...
[chromium-blink-merge.git] / content / renderer / external_popup_menu.h
blob729205fba9f8f971109c251145c2048342cacf54
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_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "third_party/WebKit/public/web/WebExternalPopupMenu.h"
12 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h"
14 namespace WebKit {
15 class WebExternalPopupMenuClient;
18 namespace content {
19 class RenderViewImpl;
21 class ExternalPopupMenu : public WebKit::WebExternalPopupMenu {
22 public:
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);
33 #endif
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
40 // WebKit::WebExternalPopupMenu implementation:
41 virtual void show(const WebKit::WebRect& bounds);
42 virtual void close();
44 private:
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_