Java Code Examples for org.chromium.chrome.browser.ChromeSwitches#HERB_FLAVOR_ELDERBERRY

The following examples show how to use org.chromium.chrome.browser.ChromeSwitches#HERB_FLAVOR_ELDERBERRY . 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: FeatureUtilities.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Caches which flavor of Herb the user prefers from native.
 */
private static void cacheHerbFlavor() {
    Context context = ContextUtils.getApplicationContext();
    if (isHerbDisallowed(context)) return;

    String oldFlavor = getHerbFlavor();

    // Check the experiment value before the command line to put the user in the correct group.
    // The first clause does the null checks so so we can freely use the startsWith() function.
    String newFlavor = FieldTrialList.findFullName(HERB_EXPERIMENT_NAME);
    Log.d(TAG, "Experiment flavor: " + newFlavor);
    if (!TextUtils.isEmpty(newFlavor)
            && newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_ELDERBERRY)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    } else {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    }

    CommandLine instance = CommandLine.getInstance();
    if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_DISABLED_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_ELDERBERRY_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    }

    Log.d(TAG, "Caching flavor: " + newFlavor);
    sCachedHerbFlavor = newFlavor;

    if (!TextUtils.equals(oldFlavor, newFlavor)) {
        ChromePreferenceManager.getInstance(context).setCachedHerbFlavor(newFlavor);
    }
}
 
Example 2
Source File: FeatureUtilities.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Caches which flavor of Herb the user prefers from native.
 */
private static void cacheHerbFlavor() {
    Context context = ContextUtils.getApplicationContext();
    if (isHerbDisallowed(context)) return;

    String oldFlavor = getHerbFlavor();

    // Check the experiment value before the command line to put the user in the correct group.
    // The first clause does the null checks so so we can freely use the startsWith() function.
    String newFlavor = FieldTrialList.findFullName(HERB_EXPERIMENT_NAME);
    Log.d(TAG, "Experiment flavor: " + newFlavor);
    if (!TextUtils.isEmpty(newFlavor)
            && newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_ELDERBERRY)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    } else {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    }

    CommandLine instance = CommandLine.getInstance();
    if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_DISABLED_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_ELDERBERRY_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    }

    Log.d(TAG, "Caching flavor: " + newFlavor);
    sCachedHerbFlavor = newFlavor;

    if (!TextUtils.equals(oldFlavor, newFlavor)) {
        ChromePreferenceManager.getInstance().setCachedHerbFlavor(newFlavor);
    }
}
 
Example 3
Source File: FeatureUtilities.java    From delion with Apache License 2.0 4 votes vote down vote up
/**
 * Caches which flavor of Herb the user prefers from native.
 */
private static void cacheHerbFlavor() {
    Context context = ContextUtils.getApplicationContext();
    if (isHerbDisallowed(context)) return;

    String oldFlavor = getHerbFlavor();

    // Check the experiment value before the command line to put the user in the correct group.
    // The first clause does the null checks so so we can freely use the startsWith() function.
    String newFlavor = FieldTrialList.findFullName(HERB_EXPERIMENT_NAME);
    Log.d(TAG, "Experiment flavor: " + newFlavor);
    if (TextUtils.isEmpty(newFlavor)
            || newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_CONTROL)
            || newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_DEFAULT)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    } else if (newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_ANISE)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ANISE;
    } else if (newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_BASIL)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_BASIL;
    } else if (newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_CHIVE)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_CHIVE;
    } else if (newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_DILL)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DILL;
    } else if (newFlavor.startsWith(ChromeSwitches.HERB_FLAVOR_ELDERBERRY)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    }

    CommandLine instance = CommandLine.getInstance();
    if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_DISABLED_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DISABLED;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_ANISE_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ANISE;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_BASIL_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_BASIL;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_CHIVE_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_CHIVE;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_DILL_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_DILL;
    } else if (instance.hasSwitch(ChromeSwitches.HERB_FLAVOR_ELDERBERRY_SWITCH)) {
        newFlavor = ChromeSwitches.HERB_FLAVOR_ELDERBERRY;
    }

    Log.d(TAG, "Caching flavor: " + newFlavor);
    sCachedHerbFlavor = newFlavor;

    if (!TextUtils.equals(oldFlavor, newFlavor)) {
        ChromePreferenceManager.getInstance(context).setCachedHerbFlavor(newFlavor);
    }
}