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

Side by Side Diff: android_webview/native/aw_web_contents_view_delegate.cc

Issue 23449027: Stop sending long press events twice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And more Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | no next file » | 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 #include "android_webview/native/aw_web_contents_view_delegate.h" 5 #include "android_webview/native/aw_web_contents_view_delegate.h"
6 6
7 #include "android_webview/native/aw_contents.h" 7 #include "android_webview/native/aw_contents.h"
boliu 2013/09/05 22:25:46 Can delete this include as well :)
8 #include "content/public/browser/android/content_view_core.h" 8 #include "content/public/browser/android/content_view_core.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_view.h" 10 #include "content/public/browser/web_contents_view.h"
11 #include "content/public/common/context_menu_params.h" 11 #include "content/public/common/context_menu_params.h"
12 12
13 namespace android_webview { 13 namespace android_webview {
14 14
15 // static 15 // static
16 content::WebContentsViewDelegate* AwWebContentsViewDelegate::Create( 16 content::WebContentsViewDelegate* AwWebContentsViewDelegate::Create(
17 content::WebContents* web_contents) { 17 content::WebContents* web_contents) {
(...skipping 22 matching lines...) Expand all
40 // ChromeWebContentsViewDelegateAndroid::ShowContextMenu. De-dup this if 40 // ChromeWebContentsViewDelegateAndroid::ShowContextMenu. De-dup this if
41 // possible. 41 // possible.
42 42
43 // Display paste pop-up only when selection is empty and editable. 43 // Display paste pop-up only when selection is empty and editable.
44 if (params.is_editable && params.selection_text.empty()) { 44 if (params.is_editable && params.selection_text.empty()) {
45 content::ContentViewCore* content_view_core = 45 content::ContentViewCore* content_view_core =
46 content::ContentViewCore::FromWebContents(web_contents_); 46 content::ContentViewCore::FromWebContents(web_contents_);
47 if (content_view_core) { 47 if (content_view_core) {
48 content_view_core->ShowPastePopup(params.selection_start.x(), 48 content_view_core->ShowPastePopup(params.selection_start.x(),
49 params.selection_start.y()); 49 params.selection_start.y());
50 return;
51 } 50 }
52 } 51 }
53
54 AwContents* aw_contents = AwContents::FromWebContents(web_contents_);
55 if (!aw_contents)
56 return;
57
58 // Context menu callback in Chromium is triggered by WebKit on an
59 // unhandled GestureLongPress event. Convert the context menu callback
60 // back into a long click event for Android WebView since the view
61 // system may choose to handle the gesture.
62 aw_contents->PerformLongClick();
63 } 52 }
64 53
65 } // namespace android_webview 54 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698