diff --git a/android/java/org/chromium/chrome/browser/onboarding/v2/HighlightDialogFragment.java b/android/java/org/chromium/chrome/browser/onboarding/v2/HighlightDialogFragment.java index bca0388bc425..aba834d1e673 100644 --- a/android/java/org/chromium/chrome/browser/onboarding/v2/HighlightDialogFragment.java +++ b/android/java/org/chromium/chrome/browser/onboarding/v2/HighlightDialogFragment.java @@ -36,9 +36,11 @@ import java.util.Arrays; import java.util.List; +import java.util.Locale; public class HighlightDialogFragment extends DialogFragment { final public static String TAG_FRAGMENT = "HIGHLIGHT_FRAG"; + private final static String NTP_TUTORIAL_PAGE = "https://brave.com/ja/android-ntp-tutorial"; public interface HighlightDialogListener { void onNextPage(); @@ -101,6 +103,7 @@ public void onPageScrollStateChanged(int state) { btnClose.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + checkAndOpenNtpPage(); dismiss(); } }); @@ -185,6 +188,7 @@ public void onNextPage() { || isFromStats) { dismiss(); BraveStatsUtil.showBraveStats(); + checkAndOpenNtpPage(); } else { viewpager.setCurrentItem(currentPage + 1); } @@ -198,4 +202,11 @@ public void onLearnMore() { ((BraveActivity)getActivity()).showOnboardingV2(false); } }; + + private void checkAndOpenNtpPage() { + String countryCode = Locale.getDefault().getCountry(); + if (((BraveActivity) getActivity()) != null && countryCode.equals("JP")) { + ((BraveActivity) getActivity()).openNewOrSelectExistingTab(NTP_TUTORIAL_PAGE); + } + } } \ No newline at end of file