Chromium Code Reviews| Index: chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc |
| diff --git a/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc b/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc |
| index 6340072ab17816e02d696f4872e05a1468e07d0f..c6eaafcba1f1cbf579f13514be7bc970106bfa76 100644 |
| --- a/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc |
| +++ b/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc |
| @@ -6,6 +6,8 @@ |
| #include "base/logging.h" |
| #include "chrome/browser/android/tab_android.h" |
| +#include "content/public/browser/android/content_view_core.h" |
| +#include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_view_delegate.h" |
| #include "content/public/common/context_menu_params.h" |
| @@ -28,10 +30,15 @@ ChromeWebContentsViewDelegateAndroid::GetDragDestDelegate() { |
| void ChromeWebContentsViewDelegateAndroid::ShowContextMenu( |
| const content::ContextMenuParams& params, |
| content::ContextMenuSourceType type) { |
| - // http://crbug.com/136075 |
| - NOTIMPLEMENTED(); |
| - // Still lacking some code here that depends on |
| - // content/public/browser/android/content_view_core.h |
| + // So we instruct the ContentView to select the text directly. |
|
olilan
2012/10/01 13:01:30
This comment doesn't match what the method does. T
|
| + if (params.is_editable && !params.selection_text.empty()) { |
|
olilan
2012/10/01 13:01:30
Should be checking for params.selection_text.empty
|
| + content::ContentViewCore* content_view_core = |
| + web_contents_->GetContentNativeView(); |
| + if (content_view_core) { |
| + content_view_core->SelectText(params.selection_text, params.x, params.y); |
| + return; |
| + } |
| + } |
| TabAndroid* tab = TabAndroid::FromWebContents(web_contents_); |
| // We may not have a Tab if we're running in Android WebView mode. |