| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ | 5 #ifndef CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |
| 6 #define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ | 6 #define CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.
h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.
h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" |
| 11 | 13 |
| 12 class RenderViewImpl; | 14 class RenderViewImpl; |
| 13 namespace WebKit { | 15 namespace WebKit { |
| 14 class WebExternalPopupMenuClient; | 16 class WebExternalPopupMenuClient; |
| 15 } | 17 } |
| 16 | 18 |
| 17 class ExternalPopupMenu : public WebKit::WebExternalPopupMenu { | 19 class ExternalPopupMenu : public WebKit::WebExternalPopupMenu { |
| 18 public: | 20 public: |
| 19 ExternalPopupMenu(RenderViewImpl* render_view, | 21 ExternalPopupMenu(RenderViewImpl* render_view, |
| 20 const WebKit::WebPopupMenuInfo& popup_menu_info, | 22 const WebKit::WebPopupMenuInfo& popup_menu_info, |
| 21 WebKit::WebExternalPopupMenuClient* popup_menu_client); | 23 WebKit::WebExternalPopupMenuClient* popup_menu_client); |
| 22 | 24 |
| 23 virtual ~ExternalPopupMenu() {} | 25 virtual ~ExternalPopupMenu() {} |
| 24 | 26 |
| 27 #if defined(OS_MACOSX) |
| 25 // Called when the user has selected an item. |selected_item| is -1 if the | 28 // Called when the user has selected an item. |selected_item| is -1 if the |
| 26 // user canceled the popup. | 29 // user canceled the popup. |
| 27 void DidSelectItem(int selected_index); | 30 void DidSelectItem(int selected_index); |
| 31 #endif |
| 32 |
| 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); |
| 36 #endif |
| 28 | 37 |
| 29 // WebKit::WebExternalPopupMenu implementation: | 38 // WebKit::WebExternalPopupMenu implementation: |
| 30 virtual void show(const WebKit::WebRect& bounds); | 39 virtual void show(const WebKit::WebRect& bounds); |
| 31 virtual void close(); | 40 virtual void close(); |
| 32 | 41 |
| 33 private: | 42 private: |
| 34 RenderViewImpl* render_view_; | 43 RenderViewImpl* render_view_; |
| 35 WebKit::WebPopupMenuInfo popup_menu_info_; | 44 WebKit::WebPopupMenuInfo popup_menu_info_; |
| 36 WebKit::WebExternalPopupMenuClient* popup_menu_client_; | 45 WebKit::WebExternalPopupMenuClient* popup_menu_client_; |
| 37 | 46 |
| 38 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); | 47 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); |
| 39 }; | 48 }; |
| 40 | 49 |
| 41 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ | 50 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |
| OLD | NEW |