| Index: chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
|
| index 9a534d717a7a8a5b88272906c472331f714c3ca1..b2421146630635824d99d86d4f1c4b4ed2760ae6 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
|
| @@ -16,6 +16,7 @@ import org.chromium.chrome.browser.ChromeFeatureList;
|
| */
|
| public class LocaleManager {
|
| public static final String PREF_PROMO_SHOWN = "LocaleManager_PREF_PROMO_SHOWN";
|
| + public static final String PREF_WAS_IN_SPECIAL_LOCALE = "LocaleManager_WAS_IN_SPECIAL_LOCALE";
|
| public static final String SPECIAL_LOCALE_ID = "US";
|
|
|
| private static LocaleManager sInstance;
|
| @@ -23,6 +24,16 @@ public class LocaleManager {
|
| private SpecialLocaleHandler mLocaleHandler;
|
|
|
| /**
|
| + * Starts listening to state changes of the phone.
|
| + */
|
| + public void observePhoneStateChanges() {}
|
| +
|
| + /**
|
| + * Stops listening to state changes of the phone.
|
| + */
|
| + public void stopObservePhoneStateChanges() {}
|
| +
|
| + /**
|
| * @return An instance of the {@link LocaleManager}.
|
| */
|
| public static LocaleManager getInstance() {
|
| @@ -47,7 +58,10 @@ public class LocaleManager {
|
| return false;
|
| }
|
| boolean inSpecialLocale = ChromeFeatureList.isEnabled("SpecialLocale");
|
| - return isReallyInSpecialLocale(inSpecialLocale);
|
| + inSpecialLocale = isReallyInSpecialLocale(inSpecialLocale);
|
| + ContextUtils.getAppSharedPreferences().edit()
|
| + .putBoolean(PREF_WAS_IN_SPECIAL_LOCALE, inSpecialLocale).apply();
|
| + return inSpecialLocale;
|
| }
|
|
|
| /**
|
| @@ -61,7 +75,6 @@ public class LocaleManager {
|
| * Adds local search engines for special locale.
|
| */
|
| public void addSpecialSearchEngines() {
|
| - // TODO(ianwen): Let this method be called in ChromeActivity#finishNativeInitialization().
|
| if (!isSpecialLocaleEnabled()) return;
|
| getSpecialLocaleHandler().loadTemplateUrls();
|
| }
|
| @@ -80,7 +93,6 @@ public class LocaleManager {
|
| * Removes local search engines for special locale.
|
| */
|
| public void removeSpecialSearchEngines() {
|
| - // TODO(ianwen): Let this method be called when device configuration changes.
|
| if (isSpecialLocaleEnabled()) return;
|
| getSpecialLocaleHandler().removeTemplateUrls();
|
| }
|
|
|