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

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

Issue 73173002: Add ContextMenu support upstream for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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
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 b65e26a2c815c6fe7f0a01c5975b882d2b879293..1aaa5d12d25adb4fd069868bcffd05f8f4b73e34 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
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.h"
#include "base/logging.h"
-#include "chrome/browser/android/tab_android.h"
+#include "chrome/browser/ui/android/context_menu_helper.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -41,12 +41,11 @@ void ChromeWebContentsViewDelegateAndroid::ShowContextMenu(
}
}
- TabAndroid* tab = TabAndroid::FromWebContents(web_contents_);
- // We may not have a Tab if we're running in Android WebView mode.
- // TODO: The long term plan is to factor out the context menu code into
- // a shared class and have WebView use a separate delegate.
- if (tab)
- tab->ShowContextMenu(params);
+ // TODO(dtrainor, kouhei): Give WebView a Populator/delegate so it can use the
+ // same context menu code.
+ ContextMenuHelper* helper = ContextMenuHelper::FromWebContents(web_contents_);
+ if (helper)
+ helper->ShowContextMenu(params);
}
namespace chrome {
« no previous file with comments | « chrome/browser/ui/android/context_menu_helper.cc ('k') | chrome/browser/ui/webui/ntp/android/context_menu_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698