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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java

Issue 2921453003: Ensure promo dialogs are dismissed when activities are destroyed. (Closed)
Patch Set: Fix comment Created 3 years, 7 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/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 ef9bf5701556930e901fa3c560762088b8261439..19491e4f2b6bce73a06358731352393108f4c776 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
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.locale;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -208,22 +209,22 @@ public class LocaleManager {
* Shows a promotion dialog about search engines depending on Locale and other conditions.
* See {@link LocaleManager#getSearchEnginePromoShowType()} for possible types and logic.
*
- * @param context Context showing the dialog.
+ * @param activity Activity showing the dialog.
* @param onDismissed Notified when the dialog is dismissed and whether the user acted on it.
* @return Whether such dialog is needed.
*/
public boolean showSearchEnginePromoIfNeeded(
- Context context, @Nullable Callback<Boolean> onDismissed) {
+ Activity activity, @Nullable Callback<Boolean> onDismissed) {
int shouldShow = getSearchEnginePromoShowType();
switch (shouldShow) {
case SEARCH_ENGINE_PROMO_DONT_SHOW:
return false;
case SEARCH_ENGINE_PROMO_SHOW_SOGOU:
- new SogouPromoDialog(context, this, onDismissed).show();
+ new SogouPromoDialog(activity, this, onDismissed).show();
return true;
case SEARCH_ENGINE_PROMO_SHOW_EXISTING:
case SEARCH_ENGINE_PROMO_SHOW_NEW:
- DefaultSearchEnginePromoDialog.show(context, shouldShow, onDismissed);
+ DefaultSearchEnginePromoDialog.show(activity, shouldShow, onDismissed);
return true;
default:
assert false;

Powered by Google App Engine
This is Rietveld 408576698