Java Code Examples for org.chromium.chrome.browser.preferences.ManagedPreferencesUtils#showManagedByAdministratorToast()

The following examples show how to use org.chromium.chrome.browser.preferences.ManagedPreferencesUtils#showManagedByAdministratorToast() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AccountSigninActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * A convenience method to create a AccountSigninActivity passing the access point as an
 * intent. Checks if the sign in flow can be started before showing the activity.
 * @param accessPoint - A SigninAccessPoint designating where the activity is created from.
 * @return {@code true} if sign in has been allowed.
 */
public static boolean startIfAllowed(Context context, @AccessPoint int accessPoint) {
    if (!SigninManager.get(context).isSignInAllowed()) {
        if (SigninManager.get(context).isSigninDisabledByPolicy()) {
            ManagedPreferencesUtils.showManagedByAdministratorToast(context);
        }
        return false;
    }

    startAccountSigninActivity(context, accessPoint);
    return true;
}
 
Example 2
Source File: SingleCategoryPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
private void showManagedToast() {
    if (mCategory.isManagedByCustodian()) {
        ManagedPreferencesUtils.showManagedByParentToast(getActivity());
    } else {
        ManagedPreferencesUtils.showManagedByAdministratorToast(getActivity());
    }
}
 
Example 3
Source File: AccountSigninActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * A convenience method to create a AccountSigninActivity passing the access point as an
 * intent. Checks if the sign in flow can be started before showing the activity.
 * @param accessPoint - A SigninAccessPoint designating where the activity is created from.
 * @return {@code true} if sign in has been allowed.
 */
public static boolean startIfAllowed(Context context, @AccessPoint int accessPoint) {
    if (!SigninManager.get(context).isSignInAllowed()) {
        if (SigninManager.get(context).isSigninDisabledByPolicy()) {
            ManagedPreferencesUtils.showManagedByAdministratorToast(context);
        }
        return false;
    }

    startAccountSigninActivity(context, accessPoint);
    return true;
}
 
Example 4
Source File: SingleCategoryPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void showManagedToast() {
    if (mCategory.isManagedByCustodian()) {
        ManagedPreferencesUtils.showManagedByParentToast(getActivity());
    } else {
        ManagedPreferencesUtils.showManagedByAdministratorToast(getActivity());
    }
}
 
Example 5
Source File: AccountSigninActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * A convenience method to create a AccountSigninActivity passing the access point as an
 * intent. Checks if the sign in flow can be started before showing the activity.
 * @param accessPoint - A SigninAccessPoint designating where the activity is created from.
 * @return {@code true} if sign in has been allowed.
 */
public static boolean startIfAllowed(Context context, @AccessPoint int accessPoint) {
    if (!SigninManager.get(context).isSignInAllowed()) {
        if (SigninManager.get(context).isSigninDisabledByPolicy()) {
            ManagedPreferencesUtils.showManagedByAdministratorToast(context);
        }
        return false;
    }

    startAccountSigninActivity(context, accessPoint);
    return true;
}
 
Example 6
Source File: SingleCategoryPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void showManagedToast() {
    if (mCategory.isManagedByCustodian()) {
        ManagedPreferencesUtils.showManagedByParentToast(getActivity());
    } else {
        ManagedPreferencesUtils.showManagedByAdministratorToast(getActivity());
    }
}