Commit 35ac37ab authored by Bence Béky's avatar Bence Béky Committed by Chromium LUCI CQ

Remove unused network prediction related enums and a method.

This is a follow-up to https://crrev.com/c/2568665.

Bug: 526773
Change-Id: I48beb93d9ca3366f519251c909da951215c6e0cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587237Reviewed-by: default avatarNatalie Chouinard <chouinard@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838276}
parent 53e3903f
......@@ -1185,7 +1185,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/previews/PreviewsUma.java",
"java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java",
"java/src/org/chromium/chrome/browser/printing/TabPrinter.java",
"java/src/org/chromium/chrome/browser/privacy/settings/BandwidthType.java",
"java/src/org/chromium/chrome/browser/privacy/settings/DoNotTrackSettings.java",
"java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerImpl.java",
"java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java",
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.privacy.settings;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Bandwidth options available based on network.
*/
public class BandwidthType {
@IntDef({Type.NEVER_PRERENDER, Type.PRERENDER_ON_WIFI, Type.ALWAYS_PRERENDER})
@Retention(RetentionPolicy.SOURCE)
public @interface Type {
// Values are numbered from 0 and can't have gaps.
int NEVER_PRERENDER = 0;
int PRERENDER_ON_WIFI = 1; // Default option.
int ALWAYS_PRERENDER = 2;
int NUM_ENTRIES = 3;
}
private static final String[] TITLES = {
"never_prefetch", "prefetch_on_wifi", "always_prefetch"};
/**
* Returns the title of the bandwidthType.
* @return title
*/
public static String title(@Type int type) {
return TITLES[type];
}
/**
* Get the BandwidthType from the title.
* @param title
* @return BandwidthType
*/
public static @BandwidthType.Type int getBandwidthFromTitle(String title) {
for (@BandwidthType.Type int i = Type.NEVER_PRERENDER; i < Type.NUM_ENTRIES; i++) {
if (TITLES[i].equals(title)) return i;
}
assert false;
return Type.PRERENDER_ON_WIFI;
}
}
......@@ -147,15 +147,6 @@ public class PrivacyPreferencesManagerImpl implements PrivacyPreferencesManager
return PrivacyPreferencesManagerImplJni.get().isMetricsReportingManaged();
}
/**
* @return Whether there is a user set value for kNetworkPredictionOptions. This should only be
* used for preference migration. See http://crbug.com/334602
*/
private boolean obsoleteNetworkPredictionOptionsHasUserSetting() {
return PrivacyPreferencesManagerImplJni.get()
.obsoleteNetworkPredictionOptionsHasUserSetting();
}
@Override
public boolean getNetworkPredictionEnabled() {
return PrivacyPreferencesManagerImplJni.get().getNetworkPredictionEnabled();
......@@ -175,7 +166,6 @@ public class PrivacyPreferencesManagerImpl implements PrivacyPreferencesManager
public interface Natives {
boolean canPrefetchAndPrerender();
boolean getNetworkPredictionManaged();
boolean obsoleteNetworkPredictionOptionsHasUserSetting();
boolean getNetworkPredictionEnabled();
void setNetworkPredictionEnabled(boolean enabled);
boolean isMetricsReportingEnabled();
......
......@@ -67,10 +67,3 @@ static void JNI_PrivacyPreferencesManagerImpl_SetNetworkPredictionEnabled(
enabled ? chrome_browser_net::NETWORK_PREDICTION_WIFI_ONLY
: chrome_browser_net::NETWORK_PREDICTION_NEVER);
}
static jboolean
JNI_PrivacyPreferencesManagerImpl_ObsoleteNetworkPredictionOptionsHasUserSetting(
JNIEnv* env) {
return GetPrefService()->GetUserPrefValue(prefs::kNetworkPredictionOptions) !=
nullptr;
}
......@@ -560,9 +560,6 @@ public final class ChromePreferenceKeys {
public static final String PRIVACY_METRICS_REPORTING = "metrics_reporting";
public static final String PRIVACY_METRICS_IN_SAMPLE = "in_metrics_sample";
public static final String PRIVACY_BANDWIDTH_OLD = "prefetch_bandwidth";
public static final String PRIVACY_BANDWIDTH_NO_CELLULAR_OLD = "prefetch_bandwidth_no_cellular";
public static final String PRIVACY_ALLOW_PRERENDER_OLD = "allow_prefetch";
public static final String PROFILES_BOOT_TIMESTAMP =
"com.google.android.apps.chrome.ChromeMobileApplication.BOOT_TIMESTAMP";
......
......@@ -39,6 +39,7 @@ public class DeprecatedChromePreferenceKeys {
"PrefMigrationVersion",
"ServiceManagerFeatures",
"allow_low_end_device_ui",
"allow_prefetch",
"allow_starting_service_manager_only",
"bookmark_search_history",
"bottom_toolbar_enabled",
......@@ -65,6 +66,8 @@ public class DeprecatedChromePreferenceKeys {
"ntp_button_variant",
"physical_web",
"physical_web_sharing",
"prefetch_bandwidth",
"prefetch_bandwidth_no_cellular",
"sole_integration_enabled",
"start_surface_single_pane_enabled",
"tab_persistent_store_task_runner_enabled",
......
......@@ -128,9 +128,6 @@ public class GrandfatheredChromePreferenceKeys {
ChromePreferenceKeys.PREFETCH_NOTIFICATION_ENABLED,
ChromePreferenceKeys.PREFETCH_NOTIFICATION_TIME,
ChromePreferenceKeys.PREFETCH_OFFLINE_COUNTER,
ChromePreferenceKeys.PRIVACY_ALLOW_PRERENDER_OLD,
ChromePreferenceKeys.PRIVACY_BANDWIDTH_NO_CELLULAR_OLD,
ChromePreferenceKeys.PRIVACY_BANDWIDTH_OLD,
ChromePreferenceKeys.PRIVACY_METRICS_IN_SAMPLE,
ChromePreferenceKeys.PRIVACY_METRICS_REPORTING,
ChromePreferenceKeys.PROFILES_BOOT_TIMESTAMP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment