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

Unified Diff: base/nix/xdg_util.cc

Issue 10735034: Linux: Detect Unity as a desktop environment. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 5 months 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
« no previous file with comments | « base/nix/xdg_util.h ('k') | chrome/browser/password_manager/password_store_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/xdg_util.cc
===================================================================
--- base/nix/xdg_util.cc (revision 147124)
+++ base/nix/xdg_util.cc (working copy)
@@ -48,6 +48,17 @@
}
DesktopEnvironment GetDesktopEnvironment(Environment* env) {
+ // XDG_CURRENT_DESKTOP is the newest standard circa 2012.
+ std::string xdg_current_desktop;
+ if (env->GetVar("XDG_CURRENT_DESKTOP", &xdg_current_desktop)) {
+ // Not all desktop environments set this env var as of this writing.
+ if (xdg_current_desktop == "Unity")
+ return DESKTOP_ENVIRONMENT_UNITY;
+ else if (xdg_current_desktop == "GNOME")
+ return DESKTOP_ENVIRONMENT_GNOME;
+ }
+
+ // DESKTOP_SESSION was what everyone used in 2010.
std::string desktop_session;
if (env->GetVar("DESKTOP_SESSION", &desktop_session)) {
if (desktop_session == "gnome") {
@@ -88,6 +99,8 @@
return "KDE3";
case DESKTOP_ENVIRONMENT_KDE4:
return "KDE4";
+ case DESKTOP_ENVIRONMENT_UNITY:
+ return "UNITY";
case DESKTOP_ENVIRONMENT_XFCE:
return "XFCE";
}
« no previous file with comments | « base/nix/xdg_util.h ('k') | chrome/browser/password_manager/password_store_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698