OLD | NEW |
1 // Copyright (c) 2012 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> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/common/features.h" |
12 #include "third_party/WebKit/public/web/WebExternalPopupMenu.h" | 13 #include "third_party/WebKit/public/web/WebExternalPopupMenu.h" |
13 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" | 14 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" |
14 #include "ui/gfx/geometry/point_f.h" | 15 #include "ui/gfx/geometry/point_f.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 class WebExternalPopupMenuClient; | 18 class WebExternalPopupMenuClient; |
18 } | 19 } |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 class RenderFrameImpl; | 22 class RenderFrameImpl; |
22 | 23 |
23 class ExternalPopupMenu : public blink::WebExternalPopupMenu { | 24 class ExternalPopupMenu : public blink::WebExternalPopupMenu { |
24 public: | 25 public: |
25 ExternalPopupMenu(RenderFrameImpl* render_frame, | 26 ExternalPopupMenu(RenderFrameImpl* render_frame, |
26 const blink::WebPopupMenuInfo& popup_menu_info, | 27 const blink::WebPopupMenuInfo& popup_menu_info, |
27 blink::WebExternalPopupMenuClient* popup_menu_client); | 28 blink::WebExternalPopupMenuClient* popup_menu_client); |
28 | 29 |
29 virtual ~ExternalPopupMenu() {} | 30 virtual ~ExternalPopupMenu() {} |
30 | 31 |
31 void SetOriginScaleAndOffsetForEmulation( | 32 void SetOriginScaleAndOffsetForEmulation( |
32 float scale, const gfx::PointF& offset); | 33 float scale, const gfx::PointF& offset); |
33 | 34 |
34 #if defined(USE_EXTERNAL_POPUP_MENU) | 35 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
35 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
36 // Called when the user has selected an item. |selected_item| is -1 if the | 37 // Called when the user has selected an item. |selected_item| is -1 if the |
37 // user canceled the popup. | 38 // user canceled the popup. |
38 void DidSelectItem(int selected_index); | 39 void DidSelectItem(int selected_index); |
39 #else | 40 #else |
40 // Called when the user has selected items or canceled the popup. | 41 // Called when the user has selected items or canceled the popup. |
41 void DidSelectItems(bool canceled, const std::vector<int>& selected_indices); | 42 void DidSelectItems(bool canceled, const std::vector<int>& selected_indices); |
42 #endif | 43 #endif |
43 #endif | 44 #endif |
44 | 45 |
(...skipping 10 matching lines...) Expand all Loading... |
55 // These scale and offset are used to properly adjust popup position. | 56 // These scale and offset are used to properly adjust popup position. |
56 float origin_scale_for_emulation_; | 57 float origin_scale_for_emulation_; |
57 gfx::PointF origin_offset_for_emulation_; | 58 gfx::PointF origin_offset_for_emulation_; |
58 | 59 |
59 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); | 60 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); |
60 }; | 61 }; |
61 | 62 |
62 } // namespace content | 63 } // namespace content |
63 | 64 |
64 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ | 65 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ |
OLD | NEW |