Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3731)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/NetworkPredictionOptions.java

Issue 1712943002: [Android] Simplify "network predictions" preference to a boolean value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/NetworkPredictionOptions.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/NetworkPredictionOptions.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/NetworkPredictionOptions.java
deleted file mode 100644
index fc8b585ace11cc68813f9bc7729e81fc6181373a..0000000000000000000000000000000000000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/NetworkPredictionOptions.java
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 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.preferences;
-
-import org.chromium.chrome.R;
-
-import java.util.Locale;
-
-/**
- * Bandwidth options available based on network.
- */
-public enum NetworkPredictionOptions {
- NETWORK_PREDICTION_ALWAYS,
- NETWORK_PREDICTION_WIFI_ONLY,
- NETWORK_PREDICTION_NEVER;
-
- public static final NetworkPredictionOptions DEFAULT = NETWORK_PREDICTION_WIFI_ONLY;
-
- /**
- * @return The number of choices offered for the user.
- */
- public static int choiceCount() {
- return values().length;
- }
-
- /**
- * Fetch the display title for the preference.
- * @return resource for the title.
- */
- public int getDisplayTitle() {
- switch(this) {
- case NETWORK_PREDICTION_ALWAYS:
- return R.string.always_prefetch_bandwidth_entry;
- case NETWORK_PREDICTION_WIFI_ONLY :
- return R.string.wifi_prefetch_bandwidth_entry;
- case NETWORK_PREDICTION_NEVER:
- return R.string.never_prefetch_bandwidth_entry;
- default:
- assert false;
- return 0;
- }
- }
-
- /**
- * Convert an integer to enum NetworkPredictionOptions.
- * @return NetworkPredictionOptions instance.
- */
- public static NetworkPredictionOptions intToEnum(int index) {
- return NetworkPredictionOptions.values()[index];
- }
-
- /**
- * Convert an enum NetworkPredictionOptions to integer.
- * @return Integer corresponding to NetworkPredictionOptions instance.
- */
- public int enumToInt() {
- return ordinal();
- }
-
- /**
- * Convert an string to enum NetworkPredictionOptions.
- * @return NetworkPredictionOptions instance.
- */
- public static NetworkPredictionOptions stringToEnum(String name) {
- return valueOf(name.toUpperCase(Locale.US));
- }
-
- /**
- * Convert an enum NetworkPredictionOptions to String.
- * @return String corresponding to NetworkPredictionOptions instance.
- */
- public String enumToString() {
- return name().toLowerCase(Locale.US);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698