Search in sources :

Example 51 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class BluetoothChooserDialog method notifyAdapterTurnedOff.

@VisibleForTesting
@CalledByNative
void notifyAdapterTurnedOff() {
    SpannableString adapterOffMessage = SpanApplier.applySpans(mActivity.getString(R.string.bluetooth_adapter_off), new SpanInfo("<link>", "</link>", new BluetoothClickableSpan(LinkType.ADAPTER_OFF, mActivity)));
    SpannableString adapterOffStatus = SpanApplier.applySpans(mActivity.getString(R.string.bluetooth_adapter_off_help), new SpanInfo("<link>", "</link>", new BluetoothClickableSpan(LinkType.ADAPTER_OFF_HELP, mActivity)));
    mItemChooserDialog.setErrorState(adapterOffMessage, adapterOffStatus);
}
Also used : SpannableString(android.text.SpannableString) SpanInfo(org.chromium.ui.text.SpanApplier.SpanInfo) VisibleForTesting(org.chromium.base.VisibleForTesting) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 52 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class AutofillKeyboardAccessoryBridge method init.

/**
     * Initializes this object.
     * This function should be called at most one time.
     * @param nativeAutofillKeyboardAccessory Handle to the native counterpart.
     * @param windowAndroid The window on which to show the suggestions.
     */
@CalledByNative
private void init(long nativeAutofillKeyboardAccessory, WindowAndroid windowAndroid) {
    if (windowAndroid == null || windowAndroid.getActivity().get() == null) {
        nativeViewDismissed(nativeAutofillKeyboardAccessory);
        dismissed();
        return;
    }
    mNativeAutofillKeyboardAccessory = nativeAutofillKeyboardAccessory;
    mAccessoryView = new AutofillKeyboardAccessory(windowAndroid, this);
    mContext = windowAndroid.getActivity().get();
}
Also used : AutofillKeyboardAccessory(org.chromium.components.autofill.AutofillKeyboardAccessory) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 53 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class AutofillPopupBridge method addToAutofillSuggestionArray.

/**
     * @param array AutofillSuggestion array that should get a new suggestion added.
     * @param index Index in the array where to place a new suggestion.
     * @param label First line of the suggestion.
     * @param sublabel Second line of the suggestion.
     * @param iconId The resource ID for the icon associated with the suggestion, or 0 for no icon.
     * @param suggestionId Identifier for the suggestion type.
     * @param deletable Whether this item is deletable.
     * @param isLabelMultiline Whether the label should be should over multiple lines.
     */
@CalledByNative
private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, String label, String sublabel, int iconId, int suggestionId, boolean deletable, boolean isLabelMultiline) {
    int drawableId = iconId == 0 ? DropdownItem.NO_ICON : ResourceId.mapToDrawableId(iconId);
    array[index] = new AutofillSuggestion(label, sublabel, drawableId, suggestionId, deletable, isLabelMultiline);
}
Also used : AutofillSuggestion(org.chromium.components.autofill.AutofillSuggestion) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 54 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class AppBannerManager method fetchAppDetails.

/**
     * Grabs package information for the banner asynchronously.
     * @param url         URL for the page that is triggering the banner.
     * @param packageName Name of the package that is being advertised.
     */
@CalledByNative
private void fetchAppDetails(String url, String packageName, String referrer, int iconSizeInDp) {
    if (sAppDetailsDelegate == null)
        return;
    Context context = ContextUtils.getApplicationContext();
    int iconSizeInPx = Math.round(context.getResources().getDisplayMetrics().density * iconSizeInDp);
    sAppDetailsDelegate.getAppDetailsAsynchronously(createAppDetailsObserver(), url, packageName, referrer, iconSizeInPx);
}
Also used : Context(android.content.Context) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 55 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class BookmarkBridge method addToBookmarkIdListWithDepth.

@CalledByNative
private static void addToBookmarkIdListWithDepth(List<BookmarkId> folderList, long id, int type, List<Integer> depthList, int depth) {
    folderList.add(new BookmarkId(id, type));
    depthList.add(depth);
}
Also used : BookmarkId(org.chromium.components.bookmarks.BookmarkId) CalledByNative(org.chromium.base.annotations.CalledByNative)

Aggregations

CalledByNative (org.chromium.base.annotations.CalledByNative)74 Activity (android.app.Activity)11 Context (android.content.Context)11 Intent (android.content.Intent)10 CastMediaRouteProvider (org.chromium.chrome.browser.media.router.cast.CastMediaRouteProvider)8 DownloadNotifier (org.chromium.chrome.browser.download.DownloadNotifier)6 View (android.view.View)5 TextView (android.widget.TextView)5 DownloadInfo (org.chromium.chrome.browser.download.DownloadInfo)5 SuppressLint (android.annotation.SuppressLint)4 PackageManager (android.content.pm.PackageManager)4 Bitmap (android.graphics.Bitmap)4 Paint (android.graphics.Paint)4 ScrollView (android.widget.ScrollView)4 ActivityManager (android.app.ActivityManager)3 ImageView (android.widget.ImageView)3 LinearLayout (android.widget.LinearLayout)3 VisibleForTesting (org.chromium.base.VisibleForTesting)3 Account (android.accounts.Account)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2