| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.preferences; | 5 package org.chromium.chrome.browser.preferences; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.SharedPreferences; | 8 import android.content.SharedPreferences; |
| 9 import android.util.Log; | 9 import android.util.Log; |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 if (currentVersion == MIGRATION_CURRENT_VERSION) return; | 152 if (currentVersion == MIGRATION_CURRENT_VERSION) return; |
| 153 if (currentVersion > MIGRATION_CURRENT_VERSION) { | 153 if (currentVersion > MIGRATION_CURRENT_VERSION) { |
| 154 Log.e(LOG_TAG, "Saved preferences version is newer than supported.
Attempting to " | 154 Log.e(LOG_TAG, "Saved preferences version is newer than supported.
Attempting to " |
| 155 + "run an older version of Chrome without clearing data is u
nsupported and " | 155 + "run an older version of Chrome without clearing data is u
nsupported and " |
| 156 + "the results may be unpredictable."); | 156 + "the results may be unpredictable."); |
| 157 } | 157 } |
| 158 | 158 |
| 159 if (currentVersion < 1) { | 159 if (currentVersion < 1) { |
| 160 nativeMigrateJavascriptPreference(); | 160 nativeMigrateJavascriptPreference(); |
| 161 } | 161 } |
| 162 // Steps 2,3 intentionally skipped. | 162 // Steps 2,3,4 intentionally skipped. |
| 163 if (currentVersion < 4) { | |
| 164 // For a brief period (M44 Beta), it was possible for users to disab
le images via Site | |
| 165 // Settings. Now that this option has been removed, ensure that user
s are not stuck with | |
| 166 // images disabled. | |
| 167 setContentSettingEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_I
MAGES, true); | |
| 168 } | |
| 169 preferences.edit().putInt(MIGRATION_PREF_KEY, MIGRATION_CURRENT_VERSION)
.apply(); | 163 preferences.edit().putInt(MIGRATION_PREF_KEY, MIGRATION_CURRENT_VERSION)
.apply(); |
| 170 } | 164 } |
| 171 | 165 |
| 172 /** | 166 /** |
| 173 * Add a permission entry for Location for the default search engine. | 167 * Add a permission entry for Location for the default search engine. |
| 174 * @param allowed Whether to create an Allowed permission or a Denied permis
sion. | 168 * @param allowed Whether to create an Allowed permission or a Denied permis
sion. |
| 175 * @param context The current context to use. | 169 * @param context The current context to use. |
| 176 */ | 170 */ |
| 177 public static void maybeCreatePermissionForDefaultSearchEngine( | 171 public static void maybeCreatePermissionForDefaultSearchEngine( |
| 178 boolean allowed, Context context) { | 172 boolean allowed, Context context) { |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 private native String nativeGetSupervisedUserSecondCustodianProfileImageURL(
); | 1219 private native String nativeGetSupervisedUserSecondCustodianProfileImageURL(
); |
| 1226 private native boolean nativeGetMetricsReportingEnabled(); | 1220 private native boolean nativeGetMetricsReportingEnabled(); |
| 1227 private native void nativeSetMetricsReportingEnabled(boolean enabled); | 1221 private native void nativeSetMetricsReportingEnabled(boolean enabled); |
| 1228 private native boolean nativeHasSetMetricsReporting(); | 1222 private native boolean nativeHasSetMetricsReporting(); |
| 1229 private native void nativeSetClickedUpdateMenuItem(boolean clicked); | 1223 private native void nativeSetClickedUpdateMenuItem(boolean clicked); |
| 1230 private native boolean nativeGetClickedUpdateMenuItem(); | 1224 private native boolean nativeGetClickedUpdateMenuItem(); |
| 1231 private native void nativeSetLatestVersionWhenClickedUpdateMenuItem(String v
ersion); | 1225 private native void nativeSetLatestVersionWhenClickedUpdateMenuItem(String v
ersion); |
| 1232 private native String nativeGetLatestVersionWhenClickedUpdateMenuItem(); | 1226 private native String nativeGetLatestVersionWhenClickedUpdateMenuItem(); |
| 1233 private native void nativeSetSupervisedUserId(String supervisedUserId); | 1227 private native void nativeSetSupervisedUserId(String supervisedUserId); |
| 1234 } | 1228 } |
| OLD | NEW |