1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2014 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 #include "xwalk/runtime/browser/android/xwalk_web_contents_view_delegate.h"
8 #include "base/command_line.h"
9 #include "content/public/browser/android/content_view_core.h"
10 #include "content/public/browser/web_contents.h"
11 #include "content/public/browser/web_contents_view.h"
12 #include "content/public/common/context_menu_params.h"
16 XWalkWebContentsViewDelegate::XWalkWebContentsViewDelegate(
17 content::WebContents* web_contents)
18 : web_contents_(web_contents) {
21 XWalkWebContentsViewDelegate::~XWalkWebContentsViewDelegate() {
24 void XWalkWebContentsViewDelegate::ShowContextMenu(
25 content::RenderFrameHost* render_frame_host,
26 const content::ContextMenuParams& params) {
27 if (params.is_editable && params.selection_text.empty()) {
28 content::ContentViewCore* content_view_core =
29 content::ContentViewCore::FromWebContents(web_contents_);
30 if (content_view_core) {
31 content_view_core->ShowPastePopup(params.selection_start.x(),
32 params.selection_start.y());
37 content::WebDragDestDelegate*
38 XWalkWebContentsViewDelegate::GetDragDestDelegate() {