Commit 3c044d00 authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

Reland "Make chrome://terms on Chrome OS same as on desktops"

This is a reland of 5d12d84a

Original change's description:
> Make chrome://terms on Chrome OS same as on desktops
>
> To show "Google Chrome and Chrome OS Additional Terms of Service"
>
> Bug: 1058348
> Change-Id: I1b37825fe6970bbc7cc59f0c1b26041e350c8fa4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132419
> Reviewed-by: Alexander Alekseev <alemate@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#756677}

TBR=alemate@chromium.org,tedchoc@chromium.org

Bug: 1058348
Change-Id: I5af75f5a1e503e4a0f6b125aba749e610e7319a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138012Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756818}
parent 6d3cd919
......@@ -56,8 +56,9 @@ namespace {
constexpr char kFakeOnlineEulaPath[] = "/intl/en-US/chrome/eula_text.html";
constexpr char kFakeOnlineEula[] = "No obligations at all";
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// See IDS_ABOUT_TERMS_OF_SERVICE for the complete text.
constexpr char kOfflineEULAWarning[] = "Chrome OS Terms";
// See IDS_TERMS_HTML for the complete text.
constexpr char kOfflineEULAWarning[] =
"Google Chrome and Chrome OS Additional Terms of Service";
#else
// Placeholder text in terms_chromium.html.
constexpr char kOfflineEULAWarning[] =
......
......@@ -227,11 +227,8 @@ class ChromeOSTermsHandler
this),
base::BindOnce(&ChromeOSTermsHandler::ResponseOnUIThread, this));
} else {
// Load local ChromeOS terms from the file.
base::ThreadPool::PostTaskAndReply(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(&ChromeOSTermsHandler::LoadEulaFileAsync, this),
base::BindOnce(&ChromeOSTermsHandler::ResponseOnUIThread, this));
NOTREACHED();
ResponseOnUIThread();
}
}
......@@ -253,23 +250,6 @@ class ChromeOSTermsHandler
}
}
void LoadEulaFileAsync() {
base::ScopedBlockingCall scoped_blocking_call(
FROM_HERE, base::BlockingType::MAY_BLOCK);
std::string file_path =
base::StringPrintf(chrome::kEULAPathFormat, locale_.c_str());
if (!base::ReadFileToString(base::FilePath(file_path), &contents_)) {
// No EULA for given language - try en-US as default.
file_path = base::StringPrintf(chrome::kEULAPathFormat, "en-US");
if (!base::ReadFileToString(base::FilePath(file_path), &contents_)) {
// File with EULA not found, ResponseOnUIThread will load EULA from
// resources if contents_ is empty.
contents_.clear();
}
}
}
void LoadArcPrivacyPolicyFileAsync() {
base::ScopedBlockingCall scoped_blocking_call(
FROM_HERE, base::BlockingType::MAY_BLOCK);
......@@ -651,11 +631,12 @@ void AboutUIHTMLSource::StartDataRequest(
#if !defined(OS_ANDROID)
} else if (source_name_ == chrome::kChromeUITermsHost) {
#if defined(OS_CHROMEOS)
ChromeOSTermsHandler::Start(path, std::move(callback));
return;
#else
response = l10n_util::GetStringUTF8(IDS_TERMS_HTML);
if (!path.empty()) {
ChromeOSTermsHandler::Start(path, std::move(callback));
return;
}
#endif
response = l10n_util::GetStringUTF8(IDS_TERMS_HTML);
#endif
}
......
......@@ -343,8 +343,6 @@ const char kCupsPrintPPDLearnMoreURL[] =
const char kEasyUnlockLearnMoreUrl[] =
"https://support.google.com/chromebook/?p=smart_lock";
const char kEULAPathFormat[] = "/usr/share/chromeos-assets/eula/%s/eula.html";
const char kArcTermsPathFormat[] = "arc_tos/%s/terms.html";
const char kArcPrivacyPolicyPathFormat[] = "arc_tos/%s/privacy_policy.pdf";
......
......@@ -294,9 +294,6 @@ extern const char kCupsPrintPPDLearnMoreURL[];
// The URL for the "Learn more" link the the Easy Unlock settings.
extern const char kEasyUnlockLearnMoreUrl[];
// The path to the offline Chrome OS EULA.
extern const char kEULAPathFormat[];
// The URL for EOL notification
extern const char kEolNotificationURL[];
......
......@@ -246,14 +246,7 @@
<release seq="1" allow_pseudo="false">
<includes>
<!-- The HTML for the about:terms page -->
<if expr="chromeos and _google_chrome">
<include name="IDS_TERMS_HTML" file="resources/terms/chromeos/terms_en.html" type="BINDATA" />
</if>
<if expr="chromeos and not _google_chrome">
<include name="IDS_TERMS_HTML" file="resources/terms/terms_chromium.html" type="BINDATA" />
</if>
<if expr="not chromeos and not is_android and not is_ios and _google_chrome">
<if expr="not is_android and not is_ios and _google_chrome">
<if expr="'am' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_am.html" type="BINDATA" /></if>
<if expr="'ar' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_ar.html" type="BINDATA" /></if>
<if expr="'bg' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_bg.html" type="BINDATA" /></if>
......@@ -308,7 +301,7 @@
<if expr="'zh-TW' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_zh-TW.html" type="BINDATA" /></if>
</if>
<if expr="not chromeos and not is_android and not is_ios and not _google_chrome">
<if expr="not is_android and not is_ios and not _google_chrome">
<include name="IDS_TERMS_HTML" file="resources/terms/terms_chromium.html" type="BINDATA" />
</if>
</includes>
......
This diff is collapsed.
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