OLD | NEW |
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 "chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delega
te_android.h" | 5 #include "chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delega
te_android.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/android/context_menu_helper.h" | 8 #include "chrome/browser/ui/android/context_menu_helper.h" |
9 #include "content/public/browser/android/content_view_core.h" | 9 #include "content/public/browser/android/content_view_core.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // and must have an implementation although android doesn't use it. | 25 // and must have an implementation although android doesn't use it. |
26 NOTREACHED(); | 26 NOTREACHED(); |
27 return NULL; | 27 return NULL; |
28 } | 28 } |
29 | 29 |
30 void ChromeWebContentsViewDelegateAndroid::ShowContextMenu( | 30 void ChromeWebContentsViewDelegateAndroid::ShowContextMenu( |
31 content::RenderFrameHost* render_frame_host, | 31 content::RenderFrameHost* render_frame_host, |
32 const content::ContextMenuParams& params) { | 32 const content::ContextMenuParams& params) { |
33 content::ContentViewCore* content_view_core = | 33 content::ContentViewCore* content_view_core = |
34 content::ContentViewCore::FromWebContents(web_contents_); | 34 content::ContentViewCore::FromWebContents(web_contents_); |
35 if (content_view_core && content_view_core->ShowPastePopup(params)) | 35 if (content_view_core && content_view_core->ShowSelectionMenu(params)) |
36 return; | 36 return; |
37 | 37 |
38 // TODO(dtrainor, kouhei): Give WebView a Populator/delegate so it can use | 38 // TODO(dtrainor, kouhei): Give WebView a Populator/delegate so it can use |
39 // the same context menu code. | 39 // the same context menu code. |
40 ContextMenuHelper* helper = | 40 ContextMenuHelper* helper = |
41 ContextMenuHelper::FromWebContents(web_contents_); | 41 ContextMenuHelper::FromWebContents(web_contents_); |
42 if (helper) | 42 if (helper) |
43 helper->ShowContextMenu(render_frame_host, params); | 43 helper->ShowContextMenu(render_frame_host, params); |
44 } | 44 } |
45 | 45 |
46 namespace chrome { | 46 namespace chrome { |
47 | 47 |
48 content::WebContentsViewDelegate* CreateWebContentsViewDelegate( | 48 content::WebContentsViewDelegate* CreateWebContentsViewDelegate( |
49 content::WebContents* web_contents) { | 49 content::WebContents* web_contents) { |
50 return new ChromeWebContentsViewDelegateAndroid(web_contents); | 50 return new ChromeWebContentsViewDelegateAndroid(web_contents); |
51 } | 51 } |
52 | 52 |
53 } // namespace chrome | 53 } // namespace chrome |
OLD | NEW |