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

Unified Diff: chrome/browser/ui/android/context_menu_helper.cc

Issue 610913004: [Android] Handle a null java side of CVC in context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/context_menu_helper.cc
diff --git a/chrome/browser/ui/android/context_menu_helper.cc b/chrome/browser/ui/android/context_menu_helper.cc
index a5db63633d49deb7dfd8f23fb3b30e031a4fab93..a941dd533bc073ab4bc5bd82b4d8befa2333018b 100644
--- a/chrome/browser/ui/android/context_menu_helper.cc
+++ b/chrome/browser/ui/android/context_menu_helper.cc
@@ -41,12 +41,18 @@ void ContextMenuHelper::ShowContextMenu(
if (!content_view_core)
return;
+ base::android::ScopedJavaLocalRef<jobject> jcontent_view_core(
+ content_view_core->GetJavaObject());
+
+ if (jcontent_view_core.is_null())
+ return;
+
JNIEnv* env = base::android::AttachCurrentThread();
context_menu_params_ = params;
Java_ContextMenuHelper_showContextMenu(
env,
java_obj_.obj(),
- content_view_core->GetJavaObject().obj(),
+ jcontent_view_core.obj(),
ContextMenuHelper::CreateJavaContextMenuParams(params).obj());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698