1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.content.browser.selection; 6 7 import android.content.Context; 8 import android.view.Menu; 9 import android.view.MenuItem; 10 import android.view.View; 11 import android.view.textclassifier.TextClassification; 12 13 /** 14 * An interface for adding more menu items. 15 */ 16 public interface AdditionalMenuItemProvider { 17 /** 18 * Add menu items to the menu passed in. 19 * @param context The context from app. 20 * @param menu Add menu items to this menu. 21 * @param classification Providing info to generate menu items. 22 */ addMenuItems(Context context, Menu menu, TextClassification classification)23 void addMenuItems(Context context, Menu menu, TextClassification classification); 24 25 /** 26 * Call this to trigger internal cleanup. 27 */ clearMenuItemListeners()28 void clearMenuItemListeners(); 29 30 /** 31 * Perform action for menu item. 32 * @param item The clicked menu item. 33 * @param view Perform action on this view. 34 */ performAction(MenuItem item, View view)35 void performAction(MenuItem item, View view); 36 } 37