commit | 57341761cdfe7520c7f17aa4901a58bfeebd5b06 | [log] [tgz] |
---|---|---|
author | Sinan Sahin <[email protected]> | Fri Sep 25 19:21:50 2020 |
committer | Commit Bot <[email protected]> | Fri Sep 25 19:21:50 2020 |
tree | d0d4217136316dd05e894c976f680269416f1880 | |
parent | b039f9b56c9fe15894332ca0c7338b6918c83375 [diff] [blame] |
Create ContextMenuPopulatorFactory Currently, the ContextMenuPopulator is a per-tab object. This requires us to pass the same set of params to #buildContextMenu() and then #onItemSelected(). Also, other methods of the class are called with the same params multiple times. This CL creates a ContextMenuPopulatorFactory and makes the ContextMenuPopulator a per-menu object. This way, we can reduce the number of params the class methods take, and we don't need to call the same methods with the same set of params many times. Change-Id: Iacfab7b35fad60cf191ea84443b456f8b60c43c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427137 Commit-Queue: Sinan Sahin <[email protected]> Reviewed-by: Ted Choc <[email protected]> Reviewed-by: Jinsuk Kim <[email protected]> Reviewed-by: Theresa <[email protected]> Cr-Commit-Position: refs/heads/master@{#810758}
diff --git a/chrome/browser/ui/android/context_menu_helper.h b/chrome/browser/ui/android/context_menu_helper.h index 4eae876..f9246880 100644 --- a/chrome/browser/ui/android/context_menu_helper.h +++ b/chrome/browser/ui/android/context_menu_helper.h
@@ -33,7 +33,8 @@ void OnContextMenuClosed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); - void SetPopulator(const base::android::JavaRef<jobject>& jpopulator); + void SetPopulatorFactory( + const base::android::JavaRef<jobject>& jpopulator_factory); private: explicit ContextMenuHelper(content::WebContents* web_contents);