Skip to content

Commit

Permalink
Remove onboarding screen for brave default serach engine
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppandya committed Oct 4, 2021
1 parent 2058682 commit 5f72f12
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
import org.chromium.url.GURL;

import java.net.URL;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.EnumSet;
Expand All @@ -132,6 +133,8 @@ public abstract class BraveToolbarLayoutImpl extends ToolbarLayout
BraveRewardsObserver, BraveRewardsNativeWorker.PublisherObserver {
public static final String PREF_HIDE_BRAVE_REWARDS_ICON = "hide_brave_rewards_icon";
private static final String JAPAN_COUNTRY_CODE = "JP";
private static final List<String> mBraveSearchEngineDefaultRegions =
Arrays.asList("CA", "DE", "FR", "GB", "US");
private static final long MB_10 = 10000000;
private static final long MINUTES_10 = 10 * 60 * 1000;
private static final int URL_FOCUS_TOOLBAR_BUTTONS_TRANSLATION_X_DP = 10;
Expand Down Expand Up @@ -939,12 +942,14 @@ public boolean onLongClick(View v) {
@Override
public void onUrlFocusChange(boolean hasFocus) {
Context context = getContext();
String countryCode = Locale.getDefault().getCountry();
if (hasFocus && PackageUtils.isFirstInstall(context)
&& BraveActivity.getBraveActivity() != null
&& BraveActivity.getBraveActivity().getActivityTab() != null
&& UrlUtilities.isNTPUrl(
BraveActivity.getBraveActivity().getActivityTab().getUrl().getSpec())
&& !OnboardingPrefManager.getInstance().hasSearchEngineOnboardingShown()) {
&& !OnboardingPrefManager.getInstance().hasSearchEngineOnboardingShown()
&& !mBraveSearchEngineDefaultRegions.contains(countryCode)) {
Intent searchActivityIntent = new Intent(context, SearchActivity.class);
context.startActivity(searchActivityIntent);
}
Expand Down

0 comments on commit 5f72f12

Please sign in to comment.