OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 9 |
10 import org.chromium.base.ContextUtils; | 10 import org.chromium.base.ContextUtils; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 /** Checks the cached value for the app link feature. */ | 349 /** Checks the cached value for the app link feature. */ |
350 public boolean getCachedInstantAppsEnabled() { | 350 public boolean getCachedInstantAppsEnabled() { |
351 return mSharedPreferences.getBoolean(INSTANT_APPS_KEY, false); | 351 return mSharedPreferences.getBoolean(INSTANT_APPS_KEY, false); |
352 } | 352 } |
353 | 353 |
354 /** Writes the cached value for whether app link is enabled. */ | 354 /** Writes the cached value for whether app link is enabled. */ |
355 public void setCachedInstantAppsEnabled(boolean isEnabled) { | 355 public void setCachedInstantAppsEnabled(boolean isEnabled) { |
356 writeBoolean(INSTANT_APPS_KEY, isEnabled); | 356 writeBoolean(INSTANT_APPS_KEY, isEnabled); |
357 } | 357 } |
358 | 358 |
359 /** Checks the cached value for the WebAPK command line flag. */ | |
360 public boolean getCachedWebApkCommandLineEnabled() { | |
361 return mSharedPreferences.getBoolean(WEBAPK_COMMAND_LINE_KEY, false); | |
362 } | |
363 | |
364 /** Sets the cached value for the WebAPK command line flag. */ | |
365 public void setCachedWebApkCommandLineEnabled(boolean isEnabled) { | |
366 writeBoolean(WEBAPK_COMMAND_LINE_KEY, isEnabled); | |
367 } | |
368 | |
369 /** Checks the cached value for the webapk feature. */ | 359 /** Checks the cached value for the webapk feature. */ |
370 public boolean getCachedWebApkRuntimeEnabled() { | 360 public boolean getCachedWebApkRuntimeEnabled() { |
371 return mSharedPreferences.getBoolean(WEBAPK_RUNTIME_KEY, false); | 361 return mSharedPreferences.getBoolean(WEBAPK_RUNTIME_KEY, false); |
372 } | 362 } |
373 | 363 |
374 /** Writes the cached value for the webapk feature is enabled. */ | 364 /** Writes the cached value for the webapk feature is enabled. */ |
375 public void setCachedWebApkRuntimeEnabled(boolean isEnabled) { | 365 public void setCachedWebApkRuntimeEnabled(boolean isEnabled) { |
376 writeBoolean(WEBAPK_RUNTIME_KEY, isEnabled); | 366 writeBoolean(WEBAPK_RUNTIME_KEY, isEnabled); |
377 } | 367 } |
378 | 368 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 * | 457 * |
468 * @param key The name of the preference to modify. | 458 * @param key The name of the preference to modify. |
469 * @param value The new value for the preference. | 459 * @param value The new value for the preference. |
470 */ | 460 */ |
471 private void writeBoolean(String key, boolean value) { | 461 private void writeBoolean(String key, boolean value) { |
472 SharedPreferences.Editor ed = mSharedPreferences.edit(); | 462 SharedPreferences.Editor ed = mSharedPreferences.edit(); |
473 ed.putBoolean(key, value); | 463 ed.putBoolean(key, value); |
474 ed.apply(); | 464 ed.apply(); |
475 } | 465 } |
476 } | 466 } |
OLD | NEW |