MENU_ITEM_TYPE_SUBMENU
};
-enum ContextMenuType {
- MENU_TYPE_LINK,
- MENU_TYPE_SELECTION
-};
-
class ContextMenuItemEfl {
public:
ContextMenuItemEfl(ContextMenuOptionType item,
static void ContextMenuItemSelectedCallback(void* data, Evas_Object* obj, void* event_info);
static void ContextMenuHWBackKey(void* data, Evas_Object* obj, void* event_info);
- ContextMenuControllerEfl(EWebView* wv, ContextMenuType type, WebContents& web_contents)
+ ContextMenuControllerEfl(EWebView* wv, WebContents& web_contents)
: webview_(wv),
native_view_(static_cast<Evas_Object*>(web_contents.GetNativeView())),
popup_(NULL),
menu_items_(NULL),
- type_(type),
web_contents_(web_contents),
weak_ptr_factory_(this) {
}
Evas_Object* native_view_;
Evas_Object* popup_;
Eina_List* menu_items_;
- ContextMenuType type_;
ContextMenuParams params_;
WebContents& web_contents_;
base::WeakPtrFactory<ContextMenuControllerEfl> weak_ptr_factory_;
return true;
}
-void EWebView::ShowContextMenu(
- const content::ContextMenuParams& params,
- content::ContextMenuType type) {
- // fix for context menu coordinates type: MENU_TYPE_LINK (introduced by CBGRAPHICS-235),
- // this menu is created in renderer process and it does not now anything about
- // view scaling factor and it has another calling sequence, so coordinates is not updated
+void EWebView::ShowContextMenu(const content::ContextMenuParams& params) {
+ // This menu is created in renderer process and it does not now anything about
+ // view scaling factor and it has another calling sequence, so coordinates is not updated.
content::ContextMenuParams convertedParams = params;
- if (type == MENU_TYPE_LINK) {
- gfx::Point convertedPoint = rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
- convertedParams.x = convertedPoint.x();
- convertedParams.y = convertedPoint.y();
- }
+ gfx::Point convertedPoint = rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
+ convertedParams.x = convertedPoint.x();
+ convertedParams.y = convertedPoint.y();
- context_menu_.reset(new content::ContextMenuControllerEfl(this, type, *web_contents_.get()));
+ context_menu_.reset(new content::ContextMenuControllerEfl(this, *web_contents_.get()));
Evas_Coord x, y;
evas_object_geometry_get(evas_object(), &x, &y, 0, 0);
Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
Eina_Bool PopupMenuClose();
- void ShowContextMenu(
- const content::ContextMenuParams& params,
- content::ContextMenuType type = content::MENU_TYPE_LINK);
+ void ShowContextMenu(const content::ContextMenuParams&);
void CancelContextMenu(int request_id);
void SetScale(double scale_factor, int x, int y);
bool GetScrollPosition(int* x, int* y) const;