Chromium Code Reviews| 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 ba033bff8b4431c2d7b12a5a75338e90ec92946a..d6e44c1aa718f97415b97681d36548fa2f0f36a6 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 |
| @@ -10,6 +10,7 @@ import android.content.SharedPreferences; |
| import android.support.annotation.IntDef; |
| import android.support.annotation.Nullable; |
| +import org.chromium.base.Callback; |
| import org.chromium.base.ContextUtils; |
| import org.chromium.base.ThreadUtils; |
| import org.chromium.chrome.R; |
| @@ -178,10 +179,11 @@ public class LocaleManager { |
| * See {@link LocaleManager#getSearchEnginePromoShowType()} for possible types and logic. |
| * |
| * @param context Context showing the dialog. |
| - * @param onDismissed Run when the dialog has been dismissed. |
| + * @param onDismissed Notified when the dialog is dismissed about whether the user acted on it. |
|
Ted C
2017/04/27 18:10:32
dismissed [and] whether the user acted on it?
gone
2017/04/27 18:15:22
little weird, but i'll go with it
|
| * @return Whether such dialog is needed. |
| */ |
| - public boolean showSearchEnginePromoIfNeeded(Context context, @Nullable Runnable onDismissed) { |
| + public boolean showSearchEnginePromoIfNeeded( |
| + Context context, @Nullable Callback<Boolean> onDismissed) { |
| int shouldShow = getSearchEnginePromoShowType(); |
| switch (shouldShow) { |
| case SEARCH_ENGINE_PROMO_DONT_SHOW: |
| @@ -191,8 +193,8 @@ public class LocaleManager { |
| return true; |
| case SEARCH_ENGINE_PROMO_SHOW_EXISTING: |
| case SEARCH_ENGINE_PROMO_SHOW_NEW: |
| - // TODO(dfalcantara): Show the search engine dialog. |
| - return false; |
| + DefaultSearchEnginePromoDialog.show(context, shouldShow, onDismissed); |
| + return true; |
| default: |
| assert false; |
| return false; |