org.chromium.chrome.browser.precache.PrecacheLauncher Java Examples

The following examples show how to use org.chromium.chrome.browser.precache.PrecacheLauncher. 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: PrivacyPreferences.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
    String key = preference.getKey();
    if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING_EXTENDED_REPORTING.equals(key)
               || PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
                (boolean) newValue);
    } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
        PrecacheLauncher.updatePrecachingEnabled(getActivity());
    } else if (PREF_NAVIGATION_ERROR.equals(key)) {
        PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
    }

    return true;
}
 
Example #2
Source File: PrivacyPreferences.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
    String key = preference.getKey();
    if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING_EXTENDED_REPORTING.equals(key)
               || PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
                (boolean) newValue);
    } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
        PrecacheLauncher.updatePrecachingEnabled(getActivity());
    } else if (PREF_NAVIGATION_ERROR.equals(key)) {
        PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
    }

    return true;
}
 
Example #3
Source File: PrivacyPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
    // CrashDumpUploadPreference listens to its own PreferenceChanged to update its text.
    // We have replaced the listener. If we do run into a CrashDumpUploadPreference change,
    // we will call onPreferenceChange to change the displayed text.
    if (preference instanceof CrashDumpUploadPreference) {
        ((CrashDumpUploadPreference) preference).onPreferenceChange(preference, newValue);
    }

    String key = preference.getKey();
    if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingEnabled((boolean) newValue);
    } else if (PREF_SAFE_BROWSING_EXTENDED_REPORTING.equals(key)) {
        PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
                (boolean) newValue);
    } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
        PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
        PrecacheLauncher.updatePrecachingEnabled(getActivity());
    } else if (PREF_NAVIGATION_ERROR.equals(key)) {
        PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
    } else if (PREF_CRASH_DUMP_UPLOAD_NO_CELLULAR.equals(key)) {
        PrefServiceBridge.getInstance().setCrashReportingEnabled((boolean) newValue);
    } else if (PREF_CRASH_DUMP_UPLOAD.equals(key)) {
        PrivacyPreferencesManager.getInstance().setUploadCrashDump((String) newValue);
    }

    return true;
}