Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: content/renderer/external_popup_menu.h

Issue 1992393002: Enable external popup menu in Blimp, part 1/2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and update blimp_engine.gn Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/external_popup_menu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 ExternalPopupMenu(RenderFrameImpl* render_frame, 25 ExternalPopupMenu(RenderFrameImpl* render_frame,
26 const blink::WebPopupMenuInfo& popup_menu_info, 26 const blink::WebPopupMenuInfo& popup_menu_info,
27 blink::WebExternalPopupMenuClient* popup_menu_client); 27 blink::WebExternalPopupMenuClient* popup_menu_client);
28 28
29 virtual ~ExternalPopupMenu() {} 29 virtual ~ExternalPopupMenu() {}
30 30
31 void SetOriginScaleAndOffsetForEmulation( 31 void SetOriginScaleAndOffsetForEmulation(
32 float scale, const gfx::PointF& offset); 32 float scale, const gfx::PointF& offset);
33 33
34 #if defined(USE_EXTERNAL_POPUP_MENU)
34 #if defined(OS_MACOSX) 35 #if defined(OS_MACOSX)
35 // Called when the user has selected an item. |selected_item| is -1 if the 36 // Called when the user has selected an item. |selected_item| is -1 if the
36 // user canceled the popup. 37 // user canceled the popup.
37 void DidSelectItem(int selected_index); 38 void DidSelectItem(int selected_index);
38 #endif 39 #else
39
40 #if defined(OS_ANDROID)
41 // Called when the user has selected items or canceled the popup. 40 // Called when the user has selected items or canceled the popup.
42 void DidSelectItems(bool canceled, const std::vector<int>& selected_indices); 41 void DidSelectItems(bool canceled, const std::vector<int>& selected_indices);
43 #endif 42 #endif
43 #endif
44 44
45 // blink::WebExternalPopupMenu implementation: 45 // blink::WebExternalPopupMenu implementation:
46 void show(const blink::WebRect& bounds) override; 46 void show(const blink::WebRect& bounds) override;
47 void close() override; 47 void close() override;
48 48
49 private: 49 private:
50 RenderFrameImpl* render_frame_; 50 RenderFrameImpl* render_frame_;
51 blink::WebPopupMenuInfo popup_menu_info_; 51 blink::WebPopupMenuInfo popup_menu_info_;
52 blink::WebExternalPopupMenuClient* popup_menu_client_; 52 blink::WebExternalPopupMenuClient* popup_menu_client_;
53 53
54 // Popups may be displaced when screen metrics emulation is enabled. 54 // Popups may be displaced when screen metrics emulation is enabled.
55 // These scale and offset are used to properly adjust popup position. 55 // These scale and offset are used to properly adjust popup position.
56 float origin_scale_for_emulation_; 56 float origin_scale_for_emulation_;
57 gfx::PointF origin_offset_for_emulation_; 57 gfx::PointF origin_offset_for_emulation_;
58 58
59 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); 59 DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu);
60 }; 60 };
61 61
62 } // namespace content 62 } // namespace content
63 63
64 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_ 64 #endif // CONTENT_RENDERER_EXTERNAL_POPUP_MENU_H_
OLDNEW
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/external_popup_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698