From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Fri, 29 Apr 2022 00:31:49 +0200 Subject: Welcome screen Allow toggling automatic updates TODO: Removed auto update code for now, need to add it back Change-Id: I4a722acfabcd9a4da886d2d164e69ac36e734813 --- .../browser/firstrun/FirstRunActivity.java | 9 ------ .../ui/signin/fre/SigninFirstRunMediator.java | 30 +++++++++---------- .../signin/fre/SigninFirstRunViewBinder.java | 4 +-- .../strings/android_chrome_strings.grd | 9 ++++++ 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java @@ -30,7 +30,6 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.signin.SigninCheckerProvider; import org.chromium.chrome.browser.signin.SigninFirstRunFragment; -import org.chromium.chrome.browser.signin.services.FREMobileIdentityConsistencyFieldTrial; import org.chromium.components.browser_ui.modaldialog.AppModalPresenter; import org.chromium.components.metrics.LowEntropySource; import org.chromium.ui.base.LocalizationUtils; @@ -204,10 +203,6 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa @Override public void triggerLayoutInflation() { - // Generate trial group as early as possible to guarantee it's available by the time native - // needs to register the synthetic trial group. See https://crbug.com/1295692 for details. - FREMobileIdentityConsistencyFieldTrial.createFirstRunVariationsTrial(); - super.triggerLayoutInflation(); initializeStateFromLaunchData(); @@ -488,10 +483,6 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa public void acceptTermsOfService(boolean allowMetricsAndCrashUploading) { assert mNativeInitializationPromise.isFulfilled(); - // If default is true then it corresponds to opt-out and false corresponds to opt-in. - UmaUtils.recordMetricsReportingDefaultOptIn(!DEFAULT_METRICS_AND_CRASH_REPORTING); - RecordHistogram.recordMediumTimesHistogram("MobileFre.FromLaunch.TosAccepted", - SystemClock.elapsedRealtime() - mIntentCreationElapsedRealtimeMs); FirstRunUtils.acceptTermsOfService(allowMetricsAndCrashUploading); FirstRunStatus.setSkipWelcomePage(true); flushPersistentData(); diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java @@ -403,27 +403,25 @@ public class SigninFirstRunMediator * disabled by policy. */ private SpannableString getFooterString(boolean isMetricsReportingDisabled) { - String footerString = mContext.getString(R.string.signin_fre_footer_tos); + String footerString = mContext.getString(R.string.bromite_fre_footer_privacy_policy); ArrayList spans = new ArrayList<>(); - // Terms of Service SpanInfo. - final NoUnderlineClickableSpan clickableTermsOfServiceSpan = + + // Adblock info and privacy policy + final NoUnderlineClickableSpan wikiSpan = new NoUnderlineClickableSpan(mContext, view - -> mDelegate.showInfoPage(ColorUtils.inNightMode(mContext) - ? R.string.google_terms_of_service_dark_mode_url - : R.string.google_terms_of_service_url)); + -> mDelegate.showInfoPage(R.string.adblock_wiki_url)); spans.add( - new SpanApplier.SpanInfo("", "", clickableTermsOfServiceSpan)); - - // Metrics and Crash Reporting SpanInfo. - if (!isMetricsReportingDisabled) { - footerString += " " + mContext.getString(R.string.signin_fre_footer_metrics_reporting); - final NoUnderlineClickableSpan clickableUMADialogSpan = - new NoUnderlineClickableSpan(mContext, view -> openUmaDialog()); - spans.add( - new SpanApplier.SpanInfo("", "", clickableUMADialogSpan)); - } + new SpanApplier.SpanInfo("", "", + wikiSpan)); + + final NoUnderlineClickableSpan privacyPolicySpan = + new NoUnderlineClickableSpan(mContext, + view + -> mDelegate.showInfoPage(R.string.adblock_updater_privacy_policy_url)); + spans.add( + new SpanApplier.SpanInfo("", "", privacyPolicySpan)); // Apply spans to footer string. return SpanApplier.applySpans(footerString, spans.toArray(new SpanApplier.SpanInfo[0])); diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunViewBinder.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunViewBinder.java --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunViewBinder.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunViewBinder.java @@ -88,12 +88,12 @@ class SigninFirstRunViewBinder { model.get(SigninFirstRunProperties.IS_SELECTED_ACCOUNT_SUPERVISED); if (isAccountSupervised) { - view.getBrowserManagedHeaderView().setVisibility(View.VISIBLE); + view.getBrowserManagedHeaderView().setVisibility(View.GONE); view.getPrivacyDisclaimer().setText(R.string.fre_browser_managed_by_parents); view.getPrivacyDisclaimer().setCompoundDrawablesRelativeWithIntrinsicBounds( R.drawable.ic_account_child_20dp, 0, 0, 0); } else if (hasPolicy) { - view.getBrowserManagedHeaderView().setVisibility(View.VISIBLE); + view.getBrowserManagedHeaderView().setVisibility(View.GONE); view.getPrivacyDisclaimer().setText(R.string.fre_browser_managed_by_organization); view.getPrivacyDisclaimer().setCompoundDrawablesRelativeWithIntrinsicBounds( R.drawable.ic_business, 0, 0, 0);