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

Side by Side Diff: content/shell/browser/shell_web_contents_view_delegate_android.cc

Issue 2724533002: Deduplicating code |WebContentsDelegateAndroid::ShowContextMenu()| (Closed)
Patch Set: ContextMenuParams is a struct Created 3 years, 9 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/public/browser/android/content_view_core.h ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_web_contents_view_delegate.h" 5 #include "content/shell/browser/shell_web_contents_view_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
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/common/context_menu_params.h" 10 #include "content/public/common/context_menu_params.h"
(...skipping 11 matching lines...) Expand all
22 WebContents* web_contents) 22 WebContents* web_contents)
23 : web_contents_(web_contents) { 23 : web_contents_(web_contents) {
24 } 24 }
25 25
26 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() { 26 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
27 } 27 }
28 28
29 void ShellWebContentsViewDelegate::ShowContextMenu( 29 void ShellWebContentsViewDelegate::ShowContextMenu(
30 RenderFrameHost* render_frame_host, 30 RenderFrameHost* render_frame_host,
31 const ContextMenuParams& params) { 31 const ContextMenuParams& params) {
32 if (params.is_editable && params.selection_text.empty()) { 32 content::ContentViewCore* content_view_core =
33 content::ContentViewCore* content_view_core = 33 ContentViewCore::FromWebContents(web_contents_);
34 ContentViewCore::FromWebContents(web_contents_); 34 if (content_view_core)
35 if (content_view_core) { 35 content_view_core->ShowPastePopup(params);
36 content_view_core->ShowPastePopup(params.selection_start.x(),
37 params.selection_start.y());
38 }
39 }
40 } 36 }
41 37
42 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/android/content_view_core.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698