Commit d86eb25c authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Try to show the printer management UI on Linux for unknown DEs.

In the current Linux ShowPrinterManagerDialog() implementation, if the
desktop environment is "OTHER" then an error log entry gets generated
and nothing else happens. To improve this, just treat it like GNOME and
try some commands that may launch the printer management UI.

BUG=869845

Change-Id: I92da6fd3edcc9ca51b9f2b494b9762d5935ba9cf
Reviewed-on: https://chromium-review.googlesource.com/1159475Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588934}
parent 50c0c3c4
...@@ -58,10 +58,6 @@ void DetectAndOpenPrinterConfigDialog() { ...@@ -58,10 +58,6 @@ void DetectAndOpenPrinterConfigDialog() {
bool opened = false; bool opened = false;
switch (base::nix::GetDesktopEnvironment(env.get())) { switch (base::nix::GetDesktopEnvironment(env.get())) {
case base::nix::DESKTOP_ENVIRONMENT_GNOME:
opened = OpenPrinterConfigDialog(kSystemConfigPrinterCommand) ||
OpenPrinterConfigDialog(kGnomeControlCenterPrintersCommand);
break;
case base::nix::DESKTOP_ENVIRONMENT_KDE4: case base::nix::DESKTOP_ENVIRONMENT_KDE4:
opened = OpenPrinterConfigDialog(kKde4KcmPrinterCommand) || opened = OpenPrinterConfigDialog(kKde4KcmPrinterCommand) ||
OpenPrinterConfigDialog(kSystemConfigPrinterCommand); OpenPrinterConfigDialog(kSystemConfigPrinterCommand);
...@@ -77,10 +73,11 @@ void DetectAndOpenPrinterConfigDialog() { ...@@ -77,10 +73,11 @@ void DetectAndOpenPrinterConfigDialog() {
case base::nix::DESKTOP_ENVIRONMENT_XFCE: case base::nix::DESKTOP_ENVIRONMENT_XFCE:
opened = OpenPrinterConfigDialog(kSystemConfigPrinterCommand); opened = OpenPrinterConfigDialog(kSystemConfigPrinterCommand);
break; break;
case base::nix::DESKTOP_ENVIRONMENT_GNOME:
case base::nix::DESKTOP_ENVIRONMENT_OTHER: case base::nix::DESKTOP_ENVIRONMENT_OTHER:
LOG(ERROR) opened = OpenPrinterConfigDialog(kSystemConfigPrinterCommand) ||
<< "Failed to detect the command to open printer config dialog"; OpenPrinterConfigDialog(kGnomeControlCenterPrintersCommand);
return; break;
} }
LOG_IF(ERROR, !opened) << "Failed to open printer manager dialog "; LOG_IF(ERROR, !opened) << "Failed to open printer manager dialog ";
} }
......
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