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

Settings: Remove printing page

chrome://settings/cloudPrinters is deprecated as of M88.

In crrev.com/c/2520081 Print Preview's "Manage" button is being
redirected to open the OS printer settings dialog, so keeping the
link to that dialog in browser settings also is no longer necessary.

Bug: 1144931
Change-Id: I7e84c82124077bd2ca71aea4c4293b633a579a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520331
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824987}
parent 65319733
...@@ -956,33 +956,10 @@ ...@@ -956,33 +956,10 @@
Notifications will be disabled Notifications will be disabled
</message> </message>
<!-- Printing --> <!-- Printing (used by OS Settings page) -->
<message name="IDS_SETTINGS_PRINTING" desc="Title of the printing page and navigation item to get there."> <message name="IDS_SETTINGS_PRINTING" desc="Title of the printing page and navigation item to get there.">
Printing Printing
</message> </message>
<message name="IDS_SETTINGS_PRINTING_NOTIFICATIONS_LABEL" desc="Label for the checkbox which enabled notifications when new printers are added to the user's network">
Show notifications when new printers are detected on the network
</message>
<message name="IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES" desc="Text for the button which allows users to manage their Google Cloud Print devices">
Manage Cloud Print devices
</message>
<if expr="not chromeos">
<message name="IDS_SETTINGS_PRINTING_LOCAL_PRINTERS_TITLE" desc="In Printing Settings, the title of local printers setting section on OS other than Chrome OS.">
Printers
</message>
</if>
<message name="IDS_SETTINGS_PRINTING_CLOUD_PRINTERS" desc="In Printing Settings, the title of the google cloud printers setting section.">
Google Cloud Print
</message>
<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>
<!-- Downloads Page --> <!-- Downloads Page -->
<message name="IDS_SETTINGS_DOWNLOADS" desc="Name of the settings page which displays download preferences."> <message name="IDS_SETTINGS_DOWNLOADS" desc="Name of the settings page which displays download preferences.">
......
...@@ -142,7 +142,6 @@ preprocess_grit("preprocess") { ...@@ -142,7 +142,6 @@ preprocess_grit("preprocess") {
"default_browser_page/default_browser_browser_proxy.js", "default_browser_page/default_browser_browser_proxy.js",
"people_page/import_data_browser_proxy.js", "people_page/import_data_browser_proxy.js",
"people_page/manage_profile_browser_proxy.js", "people_page/manage_profile_browser_proxy.js",
"printing_page/printing_browser_proxy.js",
"system_page/system_page_browser_proxy.js", "system_page/system_page_browser_proxy.js",
] ]
} }
...@@ -229,8 +228,6 @@ preprocess_grit("preprocess_generated") { ...@@ -229,8 +228,6 @@ preprocess_grit("preprocess_generated") {
"prefs/prefs_behavior.m.js", "prefs/prefs_behavior.m.js",
"prefs/prefs_types.m.js", "prefs/prefs_types.m.js",
"prefs/pref_util.m.js", "prefs/pref_util.m.js",
"printing_page/cloud_printers.js",
"printing_page/printing_page.js",
"privacy_page/collapse_radio_button.js", "privacy_page/collapse_radio_button.js",
"privacy_page/cookies_page.js", "privacy_page/cookies_page.js",
"privacy_page/do_not_track_toggle.js", "privacy_page/do_not_track_toggle.js",
...@@ -450,7 +447,6 @@ group("closure_compile_module") { ...@@ -450,7 +447,6 @@ group("closure_compile_module") {
"on_startup_page:closure_compile_module", "on_startup_page:closure_compile_module",
"people_page:closure_compile_module", "people_page:closure_compile_module",
"prefs:closure_compile_module", "prefs:closure_compile_module",
"printing_page:closure_compile_module",
"privacy_page:closure_compile_module", "privacy_page:closure_compile_module",
"reset_page:closure_compile_module", "reset_page:closure_compile_module",
"safety_check_page:closure_compile_module", "safety_check_page:closure_compile_module",
...@@ -653,7 +649,6 @@ group("polymer3_elements") { ...@@ -653,7 +649,6 @@ group("polymer3_elements") {
"on_startup_page:web_components", "on_startup_page:web_components",
"people_page:polymer3_elements", "people_page:polymer3_elements",
"prefs:polymer3_elements", "prefs:polymer3_elements",
"printing_page:web_components",
"privacy_page:polymer3_elements", "privacy_page:polymer3_elements",
"reset_page:web_components", "reset_page:web_components",
"safety_check_page:web_components", "safety_check_page:web_components",
......
...@@ -176,14 +176,6 @@ ...@@ -176,14 +176,6 @@
</settings-downloads-page> </settings-downloads-page>
</settings-section> </settings-section>
</template> </template>
<template is="dom-if" if="[[showPage_(pageVisibility.printing)]]"
restamp>
<settings-section page-title="$i18n{printingPageTitle}"
section="printing">
<settings-printing-page prefs="{{prefs}}">
</settings-printing-page>
</settings-section>
</template>
<template is="dom-if" if="[[showPage_(pageVisibility.a11y)]]" <template is="dom-if" if="[[showPage_(pageVisibility.a11y)]]"
restamp> restamp>
<settings-section page-title="$i18n{a11yPageTitle}" <settings-section page-title="$i18n{a11yPageTitle}"
......
...@@ -21,8 +21,7 @@ export function ensureLazyLoaded() { ...@@ -21,8 +21,7 @@ export function ensureLazyLoaded() {
'certificate-manager', 'certificate-manager',
// </if> // </if>
'settings-a11y-page', 'settings-downloads-page', 'settings-a11y-page', 'settings-downloads-page',
'settings-languages-page', 'settings-printing-page', 'settings-languages-page', 'settings-reset-page',
'settings-reset-page',
// <if expr="not chromeos"> // <if expr="not chromeos">
'settings-system-page', 'settings-system-page',
// </if> // </if>
......
...@@ -40,7 +40,6 @@ import 'chrome://resources/cr_components/certificate_manager/certificate_manager ...@@ -40,7 +40,6 @@ import 'chrome://resources/cr_components/certificate_manager/certificate_manager
import './a11y_page/a11y_page.js'; import './a11y_page/a11y_page.js';
import './downloads_page/downloads_page.js'; import './downloads_page/downloads_page.js';
import './languages_page/languages_page.js'; import './languages_page/languages_page.js';
import './printing_page/printing_page.js';
import './reset_page/reset_page.js'; import './reset_page/reset_page.js';
// <if expr="not chromeos"> // <if expr="not chromeos">
import './system_page/system_page.js'; import './system_page/system_page.js';
......
...@@ -16,7 +16,6 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; ...@@ -16,7 +16,6 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
* languages: (boolean|undefined), * languages: (boolean|undefined),
* onStartup: (boolean|undefined), * onStartup: (boolean|undefined),
* people: (boolean|undefined), * people: (boolean|undefined),
* printing: (boolean|undefined),
* privacy: (boolean|undefined|PrivacyPageVisibility), * privacy: (boolean|undefined|PrivacyPageVisibility),
* reset: (boolean|undefined), * reset: (boolean|undefined),
* }} * }}
...@@ -65,7 +64,6 @@ if (loadTimeData.getBoolean('isGuest')) { ...@@ -65,7 +64,6 @@ if (loadTimeData.getBoolean('isGuest')) {
defaultBrowser: false, defaultBrowser: false,
advancedSettings: false, advancedSettings: false,
extensions: false, extensions: false,
printing: false,
languages: false, languages: false,
}; };
// </if> // </if>
...@@ -90,7 +88,6 @@ if (loadTimeData.getBoolean('isGuest')) { ...@@ -90,7 +88,6 @@ if (loadTimeData.getBoolean('isGuest')) {
downloads: true, downloads: true,
a11y: true, a11y: true,
extensions: false, extensions: false,
printing: true,
languages: true, languages: true,
}; };
// </if> // </if>
...@@ -118,7 +115,6 @@ if (loadTimeData.getBoolean('isGuest')) { ...@@ -118,7 +115,6 @@ if (loadTimeData.getBoolean('isGuest')) {
downloads: true, downloads: true,
a11y: true, a11y: true,
extensions: true, extensions: true,
printing: true,
languages: true, languages: true,
}; };
// </if> // </if>
......
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/polymer/html_to_js.gni")
import("../settings.gni")
js_type_check("closure_compile_module") {
is_polymer3 = true
closure_flags = settings_closure_flags
deps = [
":cloud_printers",
":printing_page",
]
if (!is_chromeos) {
deps += [ ":printing_browser_proxy" ]
}
}
js_library("cloud_printers") {
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
}
js_library("printing_browser_proxy") {
deps = [ "//ui/webui/resources/js:cr.m" ]
}
js_library("printing_page") {
deps = [
":printing_browser_proxy",
"..:route",
"..:router.m",
"../settings_page:settings_animated_pages.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
}
html_to_js("web_components") {
js_files = [
"cloud_printers.js",
"printing_page.js",
]
}
khorimoto@chromium.org
file://chrome/browser/resources/settings/OWNERS
# COMPONENT: UI>Settings
<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" hidden$="[[hideCloudPrintWarning]]">
<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{cloudPrintersUrl}">
<div class="flex">
$i18n{printingManageCloudPrintDevices}
</div>
<cr-icon-button class="icon-external"
aria-label="$i18n{printingManageCloudPrintDevices}"></cr-icon-button>
</a>
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview 'settings-cloud-printers' is a component for showing Google
* Cloud Printer settings subpage (chrome://settings/cloudPrinters).
*/
// 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';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
Polymer({
is: 'settings-cloud-printers',
_template: html`{__html_template__}`,
properties: {
hideCloudPrintWarning: Boolean,
prefs: {
type: Object,
notify: true,
},
},
});
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview A helper object used from the Chrome printing section to
* interact with the browser. Used on operating system that is not Chrome OS.
*/
// clang-format off
import {addSingletonGetter} from 'chrome://resources/js/cr.m.js';
// clang-format on
/** @interface */
class PrintingBrowserProxy {
/**
* Open the native print system dialog.
*/
openSystemPrintDialog() {}
}
/**
* @implements {PrintingBrowserProxy}
*/
export class PrintingBrowserProxyImpl {
/** @override */
openSystemPrintDialog() {
chrome.send('openSystemPrintDialog');
}
}
addSingletonGetter(PrintingBrowserProxyImpl);
<style include="settings-shared"></style>
<settings-animated-pages id="pages" section="printing"
focus-config="[[focusConfig_]]">
<div route-path="default">
<if expr="not chromeos">
<cr-link-row label="$i18n{localPrintersTitle}"
on-click="onTapLocalPrinters_" external></cr-link-row>
</if>
<cr-link-row class="hr" id="cloudPrinters"
label="$i18n{cloudPrintersTitle}"
sub-label="[[cloudPrintersSublabel_]]"
on-click="onTapCloudPrinters_"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</div>
<template is="dom-if" route-path="/cloudPrinters">
<settings-subpage
associated-control="[[$$('#cloudPrinters')]]"
page-title="$i18n{cloudPrintersTitle}">
<settings-cloud-printers
hide-cloud-print-warning="[[shouldHideCloudPrintWarning_]]"
prefs="{{prefs}}">
</settings-cloud-printers>
</settings-subpage>
</template>
</settings-animated-pages>
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import './cloud_printers.js';
import '../settings_page/settings_animated_pages.m.js';
import '../settings_page/settings_subpage.m.js';
import '../settings_shared_css.m.js';
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {routes} from '../route.js';
import {Router} from '../router.m.js';
// <if expr="not chromeos">
import {PrintingBrowserProxyImpl} from './printing_browser_proxy.js';
// </if>
Polymer({
is: 'settings-printing-page',
_template: html`{__html_template__}`,
behaviors: [I18nBehavior],
properties: {
/** Preferences state. */
prefs: {
type: Object,
notify: true,
},
searchTerm: {
type: String,
},
/** @private */
cloudPrintersSublabel_: {
type: String,
computed: 'computeCloudPrintersSublabel_(shouldHideCloudPrintWarning_)',
},
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
value() {
const map = new Map();
if (routes.CLOUD_PRINTERS) {
map.set(routes.CLOUD_PRINTERS.path, '#cloudPrinters');
}
return map;
},
},
/** @private */
shouldHideCloudPrintWarning_: {
type: Boolean,
value: loadTimeData.getBoolean('cloudPrintDeprecationWarningsSuppressed'),
}
},
/**
* @return {string} The sublabel string for the Cloud Printers row.
* @private
*/
computeCloudPrintersSublabel_() {
return this.shouldHideCloudPrintWarning_ ? '' :
this.i18n('cloudPrintWarning');
},
// <if expr="not chromeos">
onTapLocalPrinters_() {
PrintingBrowserProxyImpl.getInstance().openSystemPrintDialog();
},
// </if>
/** @private */
onTapCloudPrinters_() {
Router.getInstance().navigateTo(routes.CLOUD_PRINTERS);
},
});
...@@ -172,9 +172,6 @@ function createBrowserSettingsRoutes() { ...@@ -172,9 +172,6 @@ function createBrowserSettingsRoutes() {
r.DOWNLOADS = r.ADVANCED.createSection('/downloads', 'downloads'); r.DOWNLOADS = r.ADVANCED.createSection('/downloads', 'downloads');
} }
r.PRINTING = r.ADVANCED.createSection('/printing', 'printing');
r.CLOUD_PRINTERS = r.PRINTING.createChild('/cloudPrinters');
r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y');
// <if expr="chromeos or is_linux"> // <if expr="chromeos or is_linux">
......
...@@ -134,7 +134,6 @@ settings_auto_imports = [ ...@@ -134,7 +134,6 @@ settings_auto_imports = [
"chrome/browser/resources/settings/i18n_setup.html|loadTimeData", "chrome/browser/resources/settings/i18n_setup.html|loadTimeData",
"chrome/browser/resources/settings/prefs/prefs_behavior.html|PrefsBehavior", "chrome/browser/resources/settings/prefs/prefs_behavior.html|PrefsBehavior",
"chrome/browser/resources/settings/prefs/prefs_types.html|CrSettingsPrefs", "chrome/browser/resources/settings/prefs/prefs_types.html|CrSettingsPrefs",
"chrome/browser/resources/settings/printing_page/printing_browser_proxy.html|PrintingBrowserProxyImpl",
"chrome/browser/resources/settings/router.html|Router,Route,RouteObserverBehavior", "chrome/browser/resources/settings/router.html|Router,Route,RouteObserverBehavior",
] ]
......
...@@ -167,12 +167,6 @@ ...@@ -167,12 +167,6 @@
<iron-icon icon="cr:file-download"></iron-icon> <iron-icon icon="cr:file-download"></iron-icon>
$i18n{downloadsPageTitle} $i18n{downloadsPageTitle}
</a> </a>
<a role="menuitem" href="/printing"
disabled$="[[!advancedOpened]]"
hidden="[[!pageVisibility.printing]]">
<iron-icon icon="cr:print"></iron-icon>
$i18n{printingPageTitle}
</a>
<a role="menuitem" href="/accessibility" <a role="menuitem" href="/accessibility"
disabled$="[[!advancedOpened]]"> disabled$="[[!advancedOpened]]">
<iron-icon icon="settings:accessibility"></iron-icon> <iron-icon icon="settings:accessibility"></iron-icon>
...@@ -207,4 +201,4 @@ ...@@ -207,4 +201,4 @@
</a> </a>
</iron-selector> </iron-selector>
</cr-menu-selector> </cr-menu-selector>
</div> </div>
\ No newline at end of file
...@@ -20,7 +20,6 @@ import {Route} from './router.m.js'; ...@@ -20,7 +20,6 @@ import {Route} from './router.m.js';
* CHECK_PASSWORDS: !Route, * CHECK_PASSWORDS: !Route,
* CHROME_CLEANUP: !Route, * CHROME_CLEANUP: !Route,
* CLEAR_BROWSER_DATA: !Route, * CLEAR_BROWSER_DATA: !Route,
* CLOUD_PRINTERS: !Route,
* COOKIES: !Route, * COOKIES: !Route,
* DEFAULT_BROWSER: !Route, * DEFAULT_BROWSER: !Route,
* DOWNLOADS: !Route, * DOWNLOADS: !Route,
...@@ -35,7 +34,6 @@ import {Route} from './router.m.js'; ...@@ -35,7 +34,6 @@ import {Route} from './router.m.js';
* DEVICE_PASSWORDS: !Route, * DEVICE_PASSWORDS: !Route,
* PAYMENTS: !Route, * PAYMENTS: !Route,
* PEOPLE: !Route, * PEOPLE: !Route,
* PRINTING: !Route,
* PRIVACY: !Route, * PRIVACY: !Route,
* RESET: !Route, * RESET: !Route,
* RESET_DIALOG: !Route, * RESET_DIALOG: !Route,
......
...@@ -4441,12 +4441,6 @@ static_library("ui") { ...@@ -4441,12 +4441,6 @@ static_library("ui") {
"//components/printing/browser", "//components/printing/browser",
"//printing", "//printing",
] ]
if (!is_chromeos && !is_android) {
sources += [
"webui/settings/printing_handler.cc",
"webui/settings/printing_handler.h",
]
}
if (use_cups) { if (use_cups) {
configs += [ "//printing:cups" ] configs += [ "//printing:cups" ]
} }
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/settings/printing_handler.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "chrome/browser/printing/printer_manager_dialog.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_ui.h"
namespace settings {
PrintingHandler::PrintingHandler() {}
PrintingHandler::~PrintingHandler() {}
void PrintingHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"openSystemPrintDialog",
base::BindRepeating(&PrintingHandler::HandleOpenSystemPrintDialog,
base::Unretained(this)));
}
void PrintingHandler::OnJavascriptAllowed() {}
void PrintingHandler::OnJavascriptDisallowed() {}
void PrintingHandler::HandleOpenSystemPrintDialog(const base::ListValue* args) {
printing::PrinterManagerDialog::ShowPrinterManagerDialog(
Profile::FromWebUI(web_ui()));
}
} // namespace settings
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PRINTING_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_PRINTING_HANDLER_H_
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
#include "printing/buildflags/buildflags.h"
#if defined(OS_CHROMEOS)
#error "Not for use on ChromeOS"
#endif
#if !BUILDFLAG(ENABLE_PRINTING)
#error "Printing must be enabled"
#endif
namespace settings {
// UI handler for Chrome printing setting subpage on operating systems other
// than Chrome OS.
class PrintingHandler : public SettingsPageUIHandler {
public:
PrintingHandler();
~PrintingHandler() override;
// SettingsPageUIHandler overrides:
void RegisterMessages() override;
void OnJavascriptAllowed() override;
void OnJavascriptDisallowed() override;
private:
void HandleOpenSystemPrintDialog(const base::ListValue* args);
DISALLOW_COPY_AND_ASSIGN(PrintingHandler);
};
} // namespace settings
#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PRINTING_HANDLER_H_
...@@ -1240,47 +1240,6 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -1240,47 +1240,6 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
AddSyncPageStrings(html_source); AddSyncPageStrings(html_source);
} }
void AddPrintingStrings(content::WebUIDataSource* html_source,
Profile* profile) {
static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"printingPageTitle", IDS_SETTINGS_PRINTING},
{"printingNotificationsLabel", IDS_SETTINGS_PRINTING_NOTIFICATIONS_LABEL},
{"printingManageCloudPrintDevices",
IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES},
{"cloudPrintersTitle", IDS_SETTINGS_PRINTING_CLOUD_PRINTERS},
#if !defined(OS_CHROMEOS)
{"localPrintersTitle", IDS_SETTINGS_PRINTING_LOCAL_PRINTERS_TITLE},
#endif
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("cloudPrintersUrl",
cloud_devices::GetCloudPrintPrintersURL().spec());
html_source->AddBoolean("cloudPrintDeprecationWarningsSuppressed",
profile->GetPrefs()->GetBoolean(
prefs::kCloudPrintDeprecationWarningsSuppressed));
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,
Profile* profile) { Profile* profile) {
static constexpr webui::LocalizedString kLocalizedStrings[] = { static constexpr webui::LocalizedString kLocalizedStrings[] = {
...@@ -2459,7 +2418,6 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, ...@@ -2459,7 +2418,6 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source,
AddLanguagesStrings(html_source, profile); AddLanguagesStrings(html_source, profile);
AddOnStartupStrings(html_source); AddOnStartupStrings(html_source);
AddPeopleStrings(html_source, profile); AddPeopleStrings(html_source, profile);
AddPrintingStrings(html_source, profile);
AddPrivacyStrings(html_source, profile); AddPrivacyStrings(html_source, profile);
AddSafetyCheckStrings(html_source); AddSafetyCheckStrings(html_source);
AddResetStrings(html_source, profile); AddResetStrings(html_source, profile);
......
...@@ -130,10 +130,6 @@ ...@@ -130,10 +130,6 @@
#include "chrome/browser/ui/webui/settings/native_certificates_handler.h" #include "chrome/browser/ui/webui/settings/native_certificates_handler.h"
#endif // defined(USE_NSS_CERTS) #endif // defined(USE_NSS_CERTS)
#if BUILDFLAG(ENABLE_PRINTING) && !defined(OS_CHROMEOS)
#include "chrome/browser/ui/webui/settings/printing_handler.h"
#endif
namespace settings { namespace settings {
// static // static
...@@ -230,10 +226,6 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) ...@@ -230,10 +226,6 @@ SettingsUI::SettingsUI(content::WebUI* web_ui)
AddSettingsPageUIHandler(std::make_unique<SystemHandler>()); AddSettingsPageUIHandler(std::make_unique<SystemHandler>());
#endif #endif
#if BUILDFLAG(ENABLE_PRINTING) && !defined(OS_CHROMEOS)
AddSettingsPageUIHandler(std::make_unique<PrintingHandler>());
#endif
#if defined(OS_WIN) #if defined(OS_WIN)
AddSettingsPageUIHandler(std::make_unique<ChromeCleanupHandler>(profile)); AddSettingsPageUIHandler(std::make_unique<ChromeCleanupHandler>(profile));
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
......
...@@ -80,7 +80,7 @@ suite('AdvancedPage', function() { ...@@ -80,7 +80,7 @@ suite('AdvancedPage', function() {
}); });
test('advanced pages', function() { test('advanced pages', function() {
const sections = ['a11y', 'languages', 'downloads', 'printing', 'reset']; const sections = ['a11y', 'languages', 'downloads', 'reset'];
for (let i = 0; i < sections.length; i++) { for (let i = 0; i < sections.length; i++) {
const section = getSection( const section = getSection(
/** @type {!SettingsBasicPageElement} */ (basicPage), sections[i]); /** @type {!SettingsBasicPageElement} */ (basicPage), sections[i]);
......
...@@ -238,8 +238,7 @@ suite('route', function() { ...@@ -238,8 +238,7 @@ suite('route', function() {
// correct path. // correct path.
window.location.href = 'https://example.com/path/to/page.html'; window.location.href = 'https://example.com/path/to/page.html';
assertEquals( assertEquals(
'chrome://settings/cloudPrinters', 'chrome://settings/cookies', routes.COOKIES.getAbsolutePath());
routes.CLOUD_PRINTERS.getAbsolutePath());
// Check getting the absolute path while inside settings returns the // Check getting the absolute path while inside settings returns the
// correct path for the current route and a different route. // correct path for the current route and a different route.
......
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