use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.
the class DomDistillerUIUtils method openSettings.
/**
* A static method for native code to call to open the distiller UI settings.
* @param webContents The WebContents containing the distilled content.
*/
@CalledByNative
public static void openSettings(WebContents webContents) {
Activity activity = getActivityFromWebContents(webContents);
if (webContents != null && activity != null) {
RecordUserAction.record("DomDistiller_DistilledPagePrefsOpened");
AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.AlertDialogTheme);
builder.setView(DistilledPagePrefsView.create(activity));
builder.show();
}
}
use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.
the class MinidumpUploadService method tryUploadCrashDumpWithLocalId.
/**
* Attempts to upload the crash report with the given local ID.
*
* Note that this method is asynchronous. All that is guaranteed is that
* upload attempts will be enqueued.
*
* This method is safe to call from the UI thread.
*
* @param context the context to use for the intent.
* @param localId The local ID of the crash report.
*/
@CalledByNative
public static void tryUploadCrashDumpWithLocalId(Context context, String localId) {
Intent intent = new Intent(context, MinidumpUploadService.class);
intent.setAction(ACTION_FORCE_UPLOAD);
intent.putExtra(LOCAL_CRASH_ID_KEY, localId);
context.startService(intent);
}
use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.
the class ContextMenuHelper method showContextMenu.
/**
* Starts showing a context menu for {@code view} based on {@code params}.
* @param contentViewCore The {@link ContentViewCore} to show the menu to.
* @param params The {@link ContextMenuParams} that indicate what menu items to show.
*/
@CalledByNative
private void showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
final View view = contentViewCore.getContainerView();
if (view == null || view.getVisibility() != View.VISIBLE || view.getParent() == null) {
return;
}
mCurrentContextMenuParams = params;
view.setOnCreateContextMenuListener(this);
if (view.showContextMenu()) {
WebContents webContents = contentViewCore.getWebContents();
RecordHistogram.recordBooleanHistogram("ContextMenu.Shown", webContents != null);
}
}
use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.
the class ContextMenuHelper method onShareImageReceived.
@CalledByNative
private void onShareImageReceived(WindowAndroid windowAndroid, byte[] jpegImageData) {
Activity activity = windowAndroid.getActivity().get();
if (activity == null)
return;
ShareHelper.shareImage(activity, jpegImageData);
}
use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.
the class ContextualSearchManager method onIcingSelectionAvailable.
/**
* Called by native code when a selection is available to share with Icing (for Conversational
* Search).
*/
@CalledByNative
private void onIcingSelectionAvailable(final String encoding, final String surroundingText, int startOffset, int endOffset) {
GSAContextDisplaySelection selection = new GSAContextDisplaySelection(encoding, surroundingText, startOffset, endOffset);
mSearchPanel.setWasSelectionPartOfUrl(ContextualSearchSelectionController.isSelectionPartOfUrl(surroundingText, startOffset, endOffset));
notifyShowContextualSearch(selection);
}
Aggregations