1 // Copyright 2015 Samsung Electronics. 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 #include "web_contents_view_delegate_ewk.h"
9 WebContentsViewDelegateEwk::WebContentsViewDelegateEwk(EWebView* wv)
13 // Note: WebContentsViewDelegate::ShowContextMenu is the hook called
14 // by chromium in response to either a long press gesture (in case of
15 // touch-based input event is the source) or a right button mouse click
16 // (in case source is mouse-based).
17 // For the former, EWK apps enter selection mode, whereas for the
18 // later, context menu is shown right way.
19 void WebContentsViewDelegateEwk::ShowContextMenu(
20 content::RenderFrameHost& render_frame_host,
21 const content::ContextMenuParams& params) {
22 if (params.source_type == ui::MENU_SOURCE_TOUCH) {
23 CHECK(web_view_->TouchEventsEnabled());
24 web_view_->HandleLongPressGesture(params);
26 web_view_->ShowContextMenu(params);
30 void WebContentsViewDelegateEwk::OnSelectionRectReceived(
31 const gfx::Rect& selection_rect) const {
32 web_view_->OnSelectionRectReceived(selection_rect);