Commit 8f39578a authored by rbpotter's avatar rbpotter Committed by Commit Bot

Settings: Add warnings for GCP deprecation

Add warnings in chrome://settings/printing and
chrome://settings/cloudPrinters for Google Cloud Print deprecation.

Redirect "Manage cloud devices" link to the cloud print printers page,
instead of chrome://devices, which is being removed.

Bug: 1114189
Change-Id: I3d4dcdcad1d85afa07082cf1b2d3713f3b50d801
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2347320
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797496}
parent a5944522
......@@ -953,6 +953,9 @@
<message name="IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_WARNING" desc="Warning shown to the user to inform them that Google Cloud Print will no longer be supported.">
Google Cloud Print will no longer be supported after December 31
</message>
<message name="IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_FULL_WARNING" desc="Warning shown to the user to inform them that Google Cloud Print will no longer be supported. Same as above, with the addition of the learn more link.">
Google Cloud Print will no longer be supported after December 31. <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;</ph>
</message>
<message name="IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_WARNING_ENTERPRISE" desc="Warning shown to users managed by enterprise policy to inform them that Google Cloud Print will no longer be supported.">
Google Cloud Print will no longer be supported after December 31. Contact your administrator.
</message>
......
......@@ -27,10 +27,6 @@
<dom-module id="os-settings-page">
<template>
<style include="settings-page-styles cr-hidden-style settings-shared">
:host {
--google-yellow-50: #fef7e0;
}
:host([is-subpage-animating]) {
/* Prevent an unwanted horizontal scrollbar when transitioning back from
* a sub-page. */
......
<style include="cr-shared-style settings-shared iron-flex"></style>
<style include="cr-shared-style settings-shared iron-flex">
#cloud-print-warning {
--google-orange-900: rgb(176, 96, 0); /* b06000 */
--warning-extra-spacing: 12px;
align-items: center;
background-color: var(--google-yellow-50);
color: var(--google-orange-900);
display: flex;
margin: 0 var(--cr-section-padding) var(--warning-extra-spacing);
min-height: var(--settings-row-min-height);
padding: 0 var(--warning-extra-spacing);
}
</style>
<div id="cloud-print-warning">
<div class="cr-padded-text">$i18nRaw{cloudPrintFullWarning}</div>
</div>
<settings-toggle-button
pref="{{prefs.local_discovery.notifications_enabled}}"
label="$i18n{printingNotificationsLabel}">
</settings-toggle-button>
<a class="cr-row inherit-color no-outline" tabindex="-1"
target="_blank" href="$i18n{devicesUrl}">
target="_blank" href="$i18n{cloudPrintersUrl}">
<div class="flex">
$i18n{printingManageCloudPrintDevices}
</div>
......
......@@ -9,6 +9,7 @@
// TODO(xdai): Rename it to 'settings-cloud-printers-page'.
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/shared_style_css.m.js';
import 'chrome://resources/cr_elements/shared_vars_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import '../controls/settings_toggle_button.m.js';
import '../settings_shared_css.m.js';
......
......@@ -7,7 +7,9 @@
on-click="onTapLocalPrinters_" external></cr-link-row>
</if>
<cr-link-row class="hr" id="cloudPrinters"
label="$i18n{cloudPrintersTitle}" on-click="onTapCloudPrinters_"
label="$i18n{cloudPrintersTitle}"
sub-label="$i18n{cloudPrintWarning}"
on-click="onTapCloudPrinters_"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</div>
......
......@@ -53,6 +53,7 @@
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/browsing_data/core/features.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
#include "components/dom_distiller/core/dom_distiller_features.h"
#include "components/google/core/common/google_util.h"
#include "components/omnibox/common/omnibox_features.h"
......@@ -1203,7 +1204,26 @@ void AddPrintingStrings(content::WebUIDataSource* html_source) {
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("devicesUrl", chrome::kChromeUIDevicesURL);
html_source->AddString("cloudPrintersUrl",
cloud_devices::GetCloudPrintPrintersURL().spec());
const bool enterprise_managed = webui::IsEnterpriseManaged();
html_source->AddLocalizedString(
"cloudPrintWarning",
enterprise_managed
? IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_WARNING_ENTERPRISE
: IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_WARNING);
if (enterprise_managed) {
html_source->AddLocalizedString(
"cloudPrintFullWarning",
IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_WARNING_ENTERPRISE);
} else {
html_source->AddString(
"cloudPrintFullWarning",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_PRINTING_GOOGLE_CLOUD_PRINT_NOT_SUPPORTED_FULL_WARNING,
base::ASCIIToUTF16(cloud_devices::kCloudPrintDeprecationHelpURL)));
}
}
void AddPrivacyStrings(content::WebUIDataSource* html_source,
......
......@@ -16,6 +16,13 @@ namespace cloud_devices {
const char kCloudPrintAuthScope[] =
"https://www.googleapis.com/auth/cloudprint";
const char kCloudPrintDeprecationHelpURL[] =
#if defined(OS_CHROMEOS)
"https://www.google.com/chromebook/?p=cloudprint";
#else
"https://www.google.com/chrome/?p=cloudprint";
#endif
const char kCloudPrintLearnMoreURL[] =
"https://www.google.com/support/cloudprint";
......@@ -58,15 +65,6 @@ GURL GetCloudPrintRelativeURL(const std::string& relative_path) {
return url.ReplaceComponents(replacements);
}
GURL GetCloudPrintSigninURL() {
GURL url(GaiaUrls::GetInstance()->service_login_url());
url = net::AppendQueryParameter(url, "service", "cloudprint");
url = net::AppendQueryParameter(url, "sarp", "1");
std::string continue_str = GetCloudPrintURL().spec();
url = net::AppendQueryParameter(url, "continue", continue_str);
return url;
}
GURL GetCloudPrintAddAccountURL() {
GURL url(GaiaUrls::GetInstance()->add_account_url());
url = net::AppendQueryParameter(url, "service", "cloudprint");
......@@ -76,14 +74,6 @@ GURL GetCloudPrintAddAccountURL() {
return url;
}
bool IsCloudPrintURL(const GURL& url) {
const GURL& cloud_print_url = GetCloudPrintURL();
return url.host_piece() == cloud_print_url.host_piece() &&
url.scheme_piece() == cloud_print_url.scheme_piece() &&
base::StartsWith(url.path(), cloud_print_url.path(),
base::CompareCase::SENSITIVE);
}
GURL GetCloudPrintEnableURL(const std::string& proxy_id) {
GURL url = GetCloudPrintRelativeURL("enable_chrome_connector/enable.html");
url = net::AppendQueryParameter(url, "proxy", proxy_id);
......@@ -105,4 +95,27 @@ GURL GetCloudPrintManageDeviceURL(const std::string& device_id) {
return GetCloudPrintURL().ReplaceComponents(replacements);
}
GURL GetCloudPrintPrintersURL() {
GURL::Replacements replacements;
replacements.SetRefStr("printers");
return GetCloudPrintURL().ReplaceComponents(replacements);
}
GURL GetCloudPrintSigninURL() {
GURL url(GaiaUrls::GetInstance()->service_login_url());
url = net::AppendQueryParameter(url, "service", "cloudprint");
url = net::AppendQueryParameter(url, "sarp", "1");
std::string continue_str = GetCloudPrintURL().spec();
url = net::AppendQueryParameter(url, "continue", continue_str);
return url;
}
bool IsCloudPrintURL(const GURL& url) {
const GURL& cloud_print_url = GetCloudPrintURL();
return url.host_piece() == cloud_print_url.host_piece() &&
url.scheme_piece() == cloud_print_url.scheme_piece() &&
base::StartsWith(url.path(), cloud_print_url.path(),
base::CompareCase::SENSITIVE);
}
} // namespace cloud_devices
......@@ -12,16 +12,18 @@
namespace cloud_devices {
extern const char kCloudPrintAuthScope[];
extern const char kCloudPrintDeprecationHelpURL[];
extern const char kCloudPrintLearnMoreURL[];
extern const char kCloudPrintTestPageURL[];
GURL GetCloudPrintURL();
GURL GetCloudPrintRelativeURL(const std::string& relative_path);
GURL GetCloudPrintAddAccountURL();
GURL GetCloudPrintEnableURL(const std::string& proxy_id);
GURL GetCloudPrintEnableWithSigninURL(const std::string& proxy_id);
GURL GetCloudPrintManageDeviceURL(const std::string& device_id);
GURL GetCloudPrintPrintersURL();
GURL GetCloudPrintSigninURL();
GURL GetCloudPrintAddAccountURL();
bool IsCloudPrintURL(const GURL& url);
} // namespace cloud_devices
......
......@@ -29,6 +29,9 @@
--google-red-600-rgb: 217, 48, 37; /* #d93025 */
--google-red-600: rgb(var(--google-red-600-rgb));
--google-yellow-50-rgb: 254, 247, 224; /* #fef7e0 */
--google-yellow-50: rgb(var(--google-yellow-50-rgb));
/* -refresh differentiate from polymer's color.html. */
--google-blue-refresh-100-rgb: 210, 227, 252; /* #d2e3fc */
--google-blue-refresh-100: rgb(var(--google-blue-refresh-100-rgb));
......
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