Commit 8cd0ac72 authored by Trevor Perrier's avatar Trevor Perrier Committed by Commit Bot

Add "Learn more" link to Lite mode FRE


This CL changes the Lite mode FRE to include a "Learn more" link that
points to the Chrome Lite mode help documents. This uses p-link "lite_mode"

The wording on the FRE page has also been changed to make indicate
that Lite mode sends web traffic to Google.



Bug: 997248
Change-Id: Idb2f69ecfefe68f1a5f6d8052d393d213283e64c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830106Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarMegan Jablonski <megjablon@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Trevor  Perrier <perrier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701632}
parent b8243a15
......@@ -57,12 +57,12 @@
android:orientation="vertical" >
<TextView
android:id="@+id/data_reduction_promo_summary_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/fre_vertical_spacing"
android:gravity="start"
android:lineSpacingMultiplier="1.4"
android:text="@string/data_reduction_promo_summary_lite_mode"
android:textAppearance="@style/TextAppearance.BlackHint2" />
<android.support.v7.widget.SwitchCompat
......
......@@ -4,18 +4,24 @@
package org.chromium.chrome.browser.firstrun;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.SwitchCompat;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.datareduction.DataReductionPromoUtils;
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.text.SpanApplier;
import org.chromium.ui.text.SpanApplier.SpanInfo;
/**
* The First Run Experience fragment that allows the user to opt in to Data Saver.
......@@ -39,6 +45,8 @@ public class DataReductionProxyFirstRunFragment extends Fragment implements Firs
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final TextView promoSummaryTextView =
(TextView) view.findViewById(R.id.data_reduction_promo_summary_text);
final SwitchCompat enableDataSaverSwitch = (SwitchCompat) view
.findViewById(R.id.enable_data_saver_switch);
Button nextButton = (Button) view.findViewById(R.id.next_button);
......@@ -57,6 +65,19 @@ public class DataReductionProxyFirstRunFragment extends Fragment implements Firs
}
});
// Setup Promo Text Learn More Link
Resources resources = getResources();
NoUnderlineClickableSpan clickablePromoLearnMoreSpan =
new NoUnderlineClickableSpan(resources, (view1) -> {
if (!isAdded()) return;
getPageDelegate().showInfoPage(R.string.data_reduction_promo_learn_more_url);
});
promoSummaryTextView.setMovementMethod(LinkMovementMethod.getInstance());
promoSummaryTextView.setText(
SpanApplier.applySpans(getString(R.string.data_reduction_promo_summary_lite_mode),
new SpanInfo("<link>", "</link>", clickablePromoLearnMoreSpan)));
nextButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
......
......@@ -1369,8 +1369,11 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_DATA_REDUCTION_PROMO_TITLE_LITE_MODE" desc="The title for the promo inviting users to enable Lite mode" >
Browse faster. Use less data.
</message>
<message name="IDS_DATA_REDUCTION_PROMO_SUMMARY_LITE_MODE" desc="Description for the promo inviting users to enable Lite mode. This informs users that their web traffic will be seen and optimized for speed and data usage, by Google servers (AKA 'Cloud technology')." meaning="The translation of percent should be spelled out instead of using the percent symbol.">
In Lite mode, Chrome loads pages faster and uses up to 60 percent less data. Google's Cloud technology optimizes the pages you visit.
<message name="IDS_DATA_REDUCTION_PROMO_SUMMARY_LITE_MODE" desc="Description for the promo inviting users to enable Lite mode. This informs users that their web traffic will sent to Google to optimize data usage. The Learn more link goes to the help center article for Lite mode." meaning="The translation of percent should be spelled out instead of using the percent symbol.">
In Lite mode, Chrome loads pages faster and uses up to 60 percent less data. To optimize the pages that you visit, Chrome sends your web traffic to Google. <ph name="BEGIN_LINK">&lt;link&gt;</ph>Learn more<ph name="END_LINK">&lt;/link&gt;</ph>
</message>
<message name="IDS_DATA_REDUCTION_PROMO_LEARN_MORE_URL" desc="URL for Lite mode help center article" translateable="false">
https://support.google.com/chrome/?p=lite_mode
</message>
<message name="IDS_DATA_REDUCTION_ENABLE_BUTTON_LITE_MODE" desc="Button the user presses if they want to enable Lite mode" >
Turn on Lite mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment