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

Unified Diff: chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc

Issue 10993089: Upstream Android implementation of WebContentsViewDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..32c739dc0b13628b912bd6f357d552cf1f0587f6 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,16 @@ 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
+ // Display paste pop-up only when selection is empty and editable.
+ if (params.is_editable && params.selection_text.empty()) {
+ content::ContentViewCore* content_view_core =
+ web_contents_->GetContentNativeView();
+ if (content_view_core) {
+ content_view_core->ShowPastePopup(params.selection_start.x(),
+ params.selection_start.y());
+ return;
+ }
+ }
TabAndroid* tab = TabAndroid::FromWebContents(web_contents_);
// We may not have a Tab if we're running in Android WebView mode.
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698