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 @@ ...@@ -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."> <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 Google Cloud Print will no longer be supported after December 31
</message> </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."> <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. Google Cloud Print will no longer be supported after December 31. Contact your administrator.
</message> </message>
......
...@@ -27,10 +27,6 @@ ...@@ -27,10 +27,6 @@
<dom-module id="os-settings-page"> <dom-module id="os-settings-page">
<template> <template>
<style include="settings-page-styles cr-hidden-style settings-shared"> <style include="settings-page-styles cr-hidden-style settings-shared">
:host {
--google-yellow-50: #fef7e0;
}
:host([is-subpage-animating]) { :host([is-subpage-animating]) {
/* Prevent an unwanted horizontal scrollbar when transitioning back from /* Prevent an unwanted horizontal scrollbar when transitioning back from
* a sub-page. */ * 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 <settings-toggle-button
pref="{{prefs.local_discovery.notifications_enabled}}" pref="{{prefs.local_discovery.notifications_enabled}}"
label="$i18n{printingNotificationsLabel}"> label="$i18n{printingNotificationsLabel}">
</settings-toggle-button> </settings-toggle-button>
<a class="cr-row inherit-color no-outline" tabindex="-1" <a class="cr-row inherit-color no-outline" tabindex="-1"
target="_blank" href="$i18n{devicesUrl}"> target="_blank" href="$i18n{cloudPrintersUrl}">
<div class="flex"> <div class="flex">
$i18n{printingManageCloudPrintDevices} $i18n{printingManageCloudPrintDevices}
</div> </div>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
// TODO(xdai): Rename it to 'settings-cloud-printers-page'. // 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/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/shared_style_css.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 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import '../controls/settings_toggle_button.m.js'; import '../controls/settings_toggle_button.m.js';
import '../settings_shared_css.m.js'; import '../settings_shared_css.m.js';
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
on-click="onTapLocalPrinters_" external></cr-link-row> on-click="onTapLocalPrinters_" external></cr-link-row>
</if> </if>
<cr-link-row class="hr" id="cloudPrinters" <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}"> role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row> </cr-link-row>
</div> </div>
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h" #include "components/autofill/core/common/autofill_payments_features.h"
#include "components/browsing_data/core/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/dom_distiller/core/dom_distiller_features.h"
#include "components/google/core/common/google_util.h" #include "components/google/core/common/google_util.h"
#include "components/omnibox/common/omnibox_features.h" #include "components/omnibox/common/omnibox_features.h"
...@@ -1203,7 +1204,26 @@ void AddPrintingStrings(content::WebUIDataSource* html_source) { ...@@ -1203,7 +1204,26 @@ void AddPrintingStrings(content::WebUIDataSource* html_source) {
}; };
AddLocalizedStringsBulk(html_source, kLocalizedStrings); 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, void AddPrivacyStrings(content::WebUIDataSource* html_source,
......
...@@ -16,6 +16,13 @@ namespace cloud_devices { ...@@ -16,6 +16,13 @@ namespace cloud_devices {
const char kCloudPrintAuthScope[] = const char kCloudPrintAuthScope[] =
"https://www.googleapis.com/auth/cloudprint"; "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[] = const char kCloudPrintLearnMoreURL[] =
"https://www.google.com/support/cloudprint"; "https://www.google.com/support/cloudprint";
...@@ -58,15 +65,6 @@ GURL GetCloudPrintRelativeURL(const std::string& relative_path) { ...@@ -58,15 +65,6 @@ GURL GetCloudPrintRelativeURL(const std::string& relative_path) {
return url.ReplaceComponents(replacements); 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 GetCloudPrintAddAccountURL() {
GURL url(GaiaUrls::GetInstance()->add_account_url()); GURL url(GaiaUrls::GetInstance()->add_account_url());
url = net::AppendQueryParameter(url, "service", "cloudprint"); url = net::AppendQueryParameter(url, "service", "cloudprint");
...@@ -76,14 +74,6 @@ GURL GetCloudPrintAddAccountURL() { ...@@ -76,14 +74,6 @@ GURL GetCloudPrintAddAccountURL() {
return url; 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 GetCloudPrintEnableURL(const std::string& proxy_id) {
GURL url = GetCloudPrintRelativeURL("enable_chrome_connector/enable.html"); GURL url = GetCloudPrintRelativeURL("enable_chrome_connector/enable.html");
url = net::AppendQueryParameter(url, "proxy", proxy_id); url = net::AppendQueryParameter(url, "proxy", proxy_id);
...@@ -105,4 +95,27 @@ GURL GetCloudPrintManageDeviceURL(const std::string& device_id) { ...@@ -105,4 +95,27 @@ GURL GetCloudPrintManageDeviceURL(const std::string& device_id) {
return GetCloudPrintURL().ReplaceComponents(replacements); 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 } // namespace cloud_devices
...@@ -12,16 +12,18 @@ ...@@ -12,16 +12,18 @@
namespace cloud_devices { namespace cloud_devices {
extern const char kCloudPrintAuthScope[]; extern const char kCloudPrintAuthScope[];
extern const char kCloudPrintDeprecationHelpURL[];
extern const char kCloudPrintLearnMoreURL[]; extern const char kCloudPrintLearnMoreURL[];
extern const char kCloudPrintTestPageURL[]; extern const char kCloudPrintTestPageURL[];
GURL GetCloudPrintURL(); GURL GetCloudPrintURL();
GURL GetCloudPrintRelativeURL(const std::string& relative_path); GURL GetCloudPrintRelativeURL(const std::string& relative_path);
GURL GetCloudPrintAddAccountURL();
GURL GetCloudPrintEnableURL(const std::string& proxy_id); GURL GetCloudPrintEnableURL(const std::string& proxy_id);
GURL GetCloudPrintEnableWithSigninURL(const std::string& proxy_id); GURL GetCloudPrintEnableWithSigninURL(const std::string& proxy_id);
GURL GetCloudPrintManageDeviceURL(const std::string& device_id); GURL GetCloudPrintManageDeviceURL(const std::string& device_id);
GURL GetCloudPrintPrintersURL();
GURL GetCloudPrintSigninURL(); GURL GetCloudPrintSigninURL();
GURL GetCloudPrintAddAccountURL();
bool IsCloudPrintURL(const GURL& url); bool IsCloudPrintURL(const GURL& url);
} // namespace cloud_devices } // namespace cloud_devices
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
--google-red-600-rgb: 217, 48, 37; /* #d93025 */ --google-red-600-rgb: 217, 48, 37; /* #d93025 */
--google-red-600: rgb(var(--google-red-600-rgb)); --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. */ /* -refresh differentiate from polymer's color.html. */
--google-blue-refresh-100-rgb: 210, 227, 252; /* #d2e3fc */ --google-blue-refresh-100-rgb: 210, 227, 252; /* #d2e3fc */
--google-blue-refresh-100: rgb(var(--google-blue-refresh-100-rgb)); --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