Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 2464403003: [CUPS] Implement the "Printers" section in chrome://settings. (Closed)
Patch Set: Address michaelpg@'s comment. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 3febc2538fb0b5865f41643e09b1003d75afa939..53ae456b49a29220c3cdc7cb456f4a47d15659b4 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -445,6 +445,8 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
IDS_OPTIONS_SETTINGS_ACCESSIBILITY_VIRTUAL_KEYBOARD_DESCRIPTION },
{ "accessibilityMonoAudio",
IDS_OPTIONS_SETTINGS_ACCESSIBILITY_MONO_AUDIO_DESCRIPTION},
+ { "advancedSectionTitleCupsPrint",
+ IDS_OPTIONS_ADVANCED_SECTION_TITLE_CUPS_PRINT },
{ "androidAppsTitle", IDS_OPTIONS_ARC_TITLE },
{ "androidAppsEnabled", IDS_OPTIONS_ARC_ENABLE },
{ "androidAppsSettingsLabel", IDS_OPTIONS_ARC_MANAGE_APPS },
@@ -466,6 +468,9 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_SHORT },
{ "changePicture", IDS_OPTIONS_CHANGE_PICTURE },
{ "changePictureCaption", IDS_OPTIONS_CHANGE_PICTURE_CAPTION },
+ { "cupsPrintOptionLabel", IDS_OPTIONS_ADVANCED_SECTION_CUPS_PRINT_LABEL },
+ { "cupsPrintersManageButton",
+ IDS_OPTIONS_ADVANCED_SECTION_CUPS_PRINT_MANAGE_BUTTON },
{ "datetimeTitle", IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME },
{ "deviceGroupDescription", IDS_OPTIONS_DEVICE_GROUP_DESCRIPTION },
{ "deviceGroupPointer", IDS_OPTIONS_DEVICE_GROUP_POINTER_SECTION },
@@ -684,6 +689,14 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref());
#endif
+#if defined(OS_CHROMEOS)
+ values->SetBoolean("cupsPrintEnabled",
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ ::switches::kEnableNativeCups));
+ values->SetString("cupsPrintLearnMoreURL",
+ chrome::kChromeUIMdCupsSettingsURL);
+#endif // defined(OS_CHROMEOS)
+
#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
values->SetBoolean("cloudPrintHideNotificationsCheckbox",
!cloud_print::PrivetNotificationService::IsEnabled());
@@ -839,6 +852,10 @@ void BrowserOptionsHandler::RegisterMessages() {
"showAccessibilityTalkBackSettings",
base::Bind(&BrowserOptionsHandler::ShowAccessibilityTalkBackSettings,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "showCupsPrintDevicesPage",
+ base::Bind(&BrowserOptionsHandler::ShowCupsPrintDevicesPage,
+ base::Unretained(this)));
#else
web_ui()->RegisterMessageCallback(
"becomeDefaultBrowser",
@@ -1710,6 +1727,17 @@ void BrowserOptionsHandler::ShowManageSSLCertificates(
}
#endif
+#if defined(OS_CHROMEOS)
+void BrowserOptionsHandler::ShowCupsPrintDevicesPage(
+ const base::ListValue* args) {
+ // Navigate in current tab to CUPS printers management page.
+ OpenURLParams params(GURL(chrome::kChromeUIMdCupsSettingsURL), Referrer(),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false);
+ web_ui()->GetWebContents()->OpenURL(params);
+}
+#endif // defined(OS_CHROMEOS)
+
#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
void BrowserOptionsHandler::ShowCloudPrintDevicesPage(
const base::ListValue* args) {
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | chrome/browser/ui/webui/print_preview/print_preview_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698