Skip to content

Commit

Permalink
Remove cross promo dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppandya committed Dec 18, 2024
1 parent f90165a commit 90c24dd
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 151 deletions.
6 changes: 0 additions & 6 deletions android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ brave_java_resources = [
"java/res/drawable-hdpi/ic_ad_free_videos.png",
"java/res/drawable-hdpi/ic_brave_onboarding.png",
"java/res/drawable-hdpi/ic_chrome.png",
"java/res/drawable-hdpi/ic_cross_modal.png",
"java/res/drawable-hdpi/ic_delete_white_24dp.png",
"java/res/drawable-hdpi/ic_expand_less_black_24dp.png",
"java/res/drawable-hdpi/ic_expand_more_black_24dp.png",
Expand Down Expand Up @@ -103,7 +102,6 @@ brave_java_resources = [
"java/res/drawable-mdpi/ic_ad_free_videos.png",
"java/res/drawable-mdpi/ic_brave_onboarding.png",
"java/res/drawable-mdpi/ic_chrome.png",
"java/res/drawable-mdpi/ic_cross_modal.png",
"java/res/drawable-mdpi/ic_delete_white_24dp.png",
"java/res/drawable-mdpi/ic_expand_less_black_24dp.png",
"java/res/drawable-mdpi/ic_expand_more_black_24dp.png",
Expand Down Expand Up @@ -182,7 +180,6 @@ brave_java_resources = [
"java/res/drawable-xhdpi/ic_ad_free_videos.png",
"java/res/drawable-xhdpi/ic_brave_onboarding.png",
"java/res/drawable-xhdpi/ic_chrome.png",
"java/res/drawable-xhdpi/ic_cross_modal.png",
"java/res/drawable-xhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xhdpi/ic_expand_less_black_24dp.png",
"java/res/drawable-xhdpi/ic_expand_more_black_24dp.png",
Expand Down Expand Up @@ -238,7 +235,6 @@ brave_java_resources = [
"java/res/drawable-xxhdpi/ic_ad_free_videos.png",
"java/res/drawable-xxhdpi/ic_brave_onboarding.png",
"java/res/drawable-xxhdpi/ic_chrome.png",
"java/res/drawable-xxhdpi/ic_cross_modal.png",
"java/res/drawable-xxhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xxhdpi/ic_expand_less_black_24dp.png",
"java/res/drawable-xxhdpi/ic_expand_more_black_24dp.png",
Expand Down Expand Up @@ -293,7 +289,6 @@ brave_java_resources = [
"java/res/drawable-xxxhdpi/ic_ad_free_videos.png",
"java/res/drawable-xxxhdpi/ic_brave_onboarding.png",
"java/res/drawable-xxxhdpi/ic_chrome.png",
"java/res/drawable-xxxhdpi/ic_cross_modal.png",
"java/res/drawable-xxxhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xxxhdpi/ic_expand_less_black_24dp.png",
"java/res/drawable-xxxhdpi/ic_expand_more_black_24dp.png",
Expand Down Expand Up @@ -886,7 +881,6 @@ brave_java_resources = [
"java/res/layout/fragment_create_account.xml",
"java/res/layout/fragment_create_custom_filters.xml",
"java/res/layout/fragment_creating_wallet.xml",
"java/res/layout/fragment_cross_promotional_modal_dialog.xml",
"java/res/layout/fragment_dapps_message.xml",
"java/res/layout/fragment_dormant_users_engagement_dialog.xml",
"java/res/layout/fragment_encryption_key.xml",
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/BraveSwipeRefreshHandler.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveSyncWorker.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveWalletProvider.java",
"../../brave/android/java/org/chromium/chrome/browser/CrossPromotionalModalDialogFragment.java",
"../../brave/android/java/org/chromium/chrome/browser/DormantUsersEngagementDialogFragment.java",
"../../brave/android/java/org/chromium/chrome/browser/InternetConnection.java",
"../../brave/android/java/org/chromium/chrome/browser/OpenYtInBraveDialogFragment.java",
Expand Down

This file was deleted.

22 changes: 0 additions & 22 deletions android/java/org/chromium/chrome/browser/app/BraveActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
import org.chromium.chrome.browser.BraveRewardsHelper;
import org.chromium.chrome.browser.BraveSyncWorker;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.CrossPromotionalModalDialogFragment;
import org.chromium.chrome.browser.DormantUsersEngagementDialogFragment;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.InternetConnection;
Expand Down Expand Up @@ -282,7 +281,6 @@ public abstract class BraveActivity extends ChromeActivity

private static final int DAYS_4 = 4;
private static final int DAYS_7 = 7;
private static final int DAYS_12 = 12;

private static final int MONTH_1 = 1;

Expand Down Expand Up @@ -1143,19 +1141,6 @@ public void finishNativeInitialization() {
// OnboardingPrefManager.getInstance().setOnboardingShownForSkip(true);
// }

if (ChromeSharedPreferences.getInstance().readInt(BravePreferenceKeys.BRAVE_APP_OPEN_COUNT)
== 1) {
Calendar calender = Calendar.getInstance();
calender.setTime(new Date());
calender.add(Calendar.DATE, DAYS_12);
OnboardingPrefManager.getInstance().setNextCrossPromoModalDate(
calender.getTimeInMillis());
}

if (OnboardingPrefManager.getInstance().showCrossPromoModal()) {
showCrossPromotionalDialog();
OnboardingPrefManager.getInstance().setCrossPromoModalShown(true);
}
BraveSyncAccountDeletedInformer.show();

if (!OnboardingPrefManager.getInstance().isOneTimeNotificationStarted() && isFirstInstall) {
Expand Down Expand Up @@ -2066,13 +2051,6 @@ private void showBraveRateDialog() {
rateDialogFragment.show(getSupportFragmentManager(), BraveRateDialogFragment.TAG_FRAGMENT);
}

private void showCrossPromotionalDialog() {
CrossPromotionalModalDialogFragment mCrossPromotionalModalDialogFragment =
new CrossPromotionalModalDialogFragment();
mCrossPromotionalModalDialogFragment.show(
getSupportFragmentManager(), "CrossPromotionalModalDialogFragment");
}

private void openYtInBraveDialog() {
OpenYtInBraveDialogFragment mOpenYtInBraveDialogFragment =
new OpenYtInBraveDialogFragment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public class OnboardingPrefManager {

private static final String PREF_ONBOARDING = "onboarding";
private static final String PREF_P3A_ONBOARDING = "p3a_onboarding";
private static final String PREF_CROSS_PROMO_MODAL = "cross_promo_modal";
private static final String PREF_ONBOARDING_V2 = "onboarding_v2";
private static final String PREF_NEXT_CROSS_PROMO_MODAL_DATE = "next_cross_promo_modal_date";
private static final String PREF_SEARCH_ENGINE_ONBOARDING = "search_engine_onboarding";
public static final String PREF_BRAVE_STATS = "brave_stats";
public static final String PREF_BRAVE_STATS_NOTIFICATION = "brave_stats_notification";
Expand Down Expand Up @@ -237,33 +235,6 @@ public void onboardingNotification() {
}
}

private long getNextCrossPromoModalDate() {
return mSharedPreferences.getLong(PREF_NEXT_CROSS_PROMO_MODAL_DATE, 0);
}

public void setNextCrossPromoModalDate(long nextDate) {
SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
sharedPreferencesEditor.putLong(PREF_NEXT_CROSS_PROMO_MODAL_DATE, nextDate);
sharedPreferencesEditor.apply();
}

public void setCrossPromoModalShown(boolean isShown) {
SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
sharedPreferencesEditor.putBoolean(PREF_CROSS_PROMO_MODAL, isShown);
sharedPreferencesEditor.apply();
}

private boolean hasCrossPromoModalShown() {
return mSharedPreferences.getBoolean(PREF_CROSS_PROMO_MODAL, false);
}

public boolean showCrossPromoModal() {
boolean shouldShow = !hasCrossPromoModalShown()
&& (getNextCrossPromoModalDate() > 0
&& System.currentTimeMillis() > getNextCrossPromoModalDate());
return shouldShow;
}

public static Map<String, SearchEngineEnum> searchEngineMap =
Map.ofEntries(
Map.entry(GOOGLE, SearchEngineEnum.GOOGLE),
Expand Down
Binary file removed android/java/res/drawable-hdpi/ic_cross_modal.png
Binary file not shown.
Binary file removed android/java/res/drawable-mdpi/ic_cross_modal.png
Binary file not shown.
Binary file removed android/java/res/drawable-xhdpi/ic_cross_modal.png
Binary file not shown.
Binary file removed android/java/res/drawable-xxhdpi/ic_cross_modal.png
Binary file not shown.
Binary file not shown.

This file was deleted.

6 changes: 0 additions & 6 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -1708,12 +1708,6 @@ Are you sure you want to do this?
<message name="IDS_NO_THANK_YOU" desc="Open youtube in brave modal negative action text">
No, thank you
</message>
<message name="IDS_BRAVE_WORKS_EVERYWHERE" desc="Cross promotional modal title text">
Brave works everywhere
</message>
<message name="IDS_DOWNLOAD_BRAVE" desc="Cross promotional modal text">
Download Brave at brave.com on your laptop or tablet for a faster and more private web
</message>
<message name="IDS_PRIVACY_PROTECTION" desc="Title for onboading bottomsheet.">
Privacy protection
</message>
Expand Down

0 comments on commit 90c24dd

Please sign in to comment.