org.chromium.chrome.browser.preferences.ManagedPreferencesUtils Java Examples

The following examples show how to use org.chromium.chrome.browser.preferences.ManagedPreferencesUtils. 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: AppMenuPropertiesDelegate.java    From delion with Apache License 2.0 5 votes vote down vote up
private void disableEnableMenuItem(
        Menu menu, int id, boolean visible, boolean enabled, boolean managed) {
    for (int i = 0; i < menu.size(); ++i) {
        MenuItem item = menu.getItem(i);
        if (item.getItemId() == id && item.isVisible()) {
            item.setVisible(visible);
            item.setEnabled(enabled);
            if (managed) {
                item.setIcon(ManagedPreferencesUtils.getManagedByEnterpriseIconId());
            } else {
                item.setIcon(null);
            }
        }
    }
}
 
Example #2
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 #3
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 #4
Source File: AppMenuPropertiesDelegate.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void disableEnableMenuItem(
        Menu menu, int id, boolean visible, boolean enabled, boolean managed) {
    for (int i = 0; i < menu.size(); ++i) {
        MenuItem item = menu.getItem(i);
        if (item.getItemId() == id && item.isVisible()) {
            item.setVisible(visible);
            item.setEnabled(enabled);
            if (managed) {
                item.setIcon(ManagedPreferencesUtils.getManagedByEnterpriseIconId());
            } else {
                item.setIcon(null);
            }
        }
    }
}
 
Example #5
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 #6
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 #7
Source File: AppMenuPropertiesDelegate.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void disableEnableMenuItem(
        Menu menu, int id, boolean visible, boolean enabled, boolean managed) {
    for (int i = 0; i < menu.size(); ++i) {
        MenuItem item = menu.getItem(i);
        if (item.getItemId() == id && item.isVisible()) {
            item.setVisible(visible);
            item.setEnabled(enabled);
            if (managed) {
                item.setIcon(ManagedPreferencesUtils.getManagedByEnterpriseIconId());
            } else {
                item.setIcon(null);
            }
        }
    }
}
 
Example #8
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 #9
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());
    }
}