Commit 5d12d84a authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

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/+/2132419Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756677}
parent a0a17aa8
...@@ -227,11 +227,8 @@ class ChromeOSTermsHandler ...@@ -227,11 +227,8 @@ class ChromeOSTermsHandler
this), this),
base::BindOnce(&ChromeOSTermsHandler::ResponseOnUIThread, this)); base::BindOnce(&ChromeOSTermsHandler::ResponseOnUIThread, this));
} else { } else {
// Load local ChromeOS terms from the file. NOTREACHED();
base::ThreadPool::PostTaskAndReply( ResponseOnUIThread();
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(&ChromeOSTermsHandler::LoadEulaFileAsync, this),
base::BindOnce(&ChromeOSTermsHandler::ResponseOnUIThread, this));
} }
} }
...@@ -253,23 +250,6 @@ class ChromeOSTermsHandler ...@@ -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() { void LoadArcPrivacyPolicyFileAsync() {
base::ScopedBlockingCall scoped_blocking_call( base::ScopedBlockingCall scoped_blocking_call(
FROM_HERE, base::BlockingType::MAY_BLOCK); FROM_HERE, base::BlockingType::MAY_BLOCK);
...@@ -651,11 +631,12 @@ void AboutUIHTMLSource::StartDataRequest( ...@@ -651,11 +631,12 @@ void AboutUIHTMLSource::StartDataRequest(
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
} else if (source_name_ == chrome::kChromeUITermsHost) { } else if (source_name_ == chrome::kChromeUITermsHost) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
ChromeOSTermsHandler::Start(path, std::move(callback)); if (!path.empty()) {
return; ChromeOSTermsHandler::Start(path, std::move(callback));
#else return;
response = l10n_util::GetStringUTF8(IDS_TERMS_HTML); }
#endif #endif
response = l10n_util::GetStringUTF8(IDS_TERMS_HTML);
#endif #endif
} }
......
...@@ -343,8 +343,6 @@ const char kCupsPrintPPDLearnMoreURL[] = ...@@ -343,8 +343,6 @@ const char kCupsPrintPPDLearnMoreURL[] =
const char kEasyUnlockLearnMoreUrl[] = const char kEasyUnlockLearnMoreUrl[] =
"https://support.google.com/chromebook/?p=smart_lock"; "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 kArcTermsPathFormat[] = "arc_tos/%s/terms.html";
const char kArcPrivacyPolicyPathFormat[] = "arc_tos/%s/privacy_policy.pdf"; const char kArcPrivacyPolicyPathFormat[] = "arc_tos/%s/privacy_policy.pdf";
......
...@@ -294,9 +294,6 @@ extern const char kCupsPrintPPDLearnMoreURL[]; ...@@ -294,9 +294,6 @@ extern const char kCupsPrintPPDLearnMoreURL[];
// The URL for the "Learn more" link the the Easy Unlock settings. // The URL for the "Learn more" link the the Easy Unlock settings.
extern const char kEasyUnlockLearnMoreUrl[]; extern const char kEasyUnlockLearnMoreUrl[];
// The path to the offline Chrome OS EULA.
extern const char kEULAPathFormat[];
// The URL for EOL notification // The URL for EOL notification
extern const char kEolNotificationURL[]; extern const char kEolNotificationURL[];
......
...@@ -246,14 +246,7 @@ ...@@ -246,14 +246,7 @@
<release seq="1" allow_pseudo="false"> <release seq="1" allow_pseudo="false">
<includes> <includes>
<!-- The HTML for the about:terms page --> <!-- The HTML for the about:terms page -->
<if expr="chromeos and _google_chrome"> <if expr="not is_android and not is_ios 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="'am' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_am.html" type="BINDATA" /></if> <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="'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> <if expr="'bg' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_bg.html" type="BINDATA" /></if>
...@@ -308,7 +301,7 @@ ...@@ -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 expr="'zh-TW' == lang"> <include name="IDS_TERMS_HTML" file="resources/terms/terms_zh-TW.html" type="BINDATA" /></if>
</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" /> <include name="IDS_TERMS_HTML" file="resources/terms/terms_chromium.html" type="BINDATA" />
</if> </if>
</includes> </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