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

Unified Diff: base/linux_util.cc

Issue 174106: Linux: make the "change proxy settings" button able to start several proxy config utilities. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
Index: base/linux_util.cc
===================================================================
--- base/linux_util.cc (revision 23785)
+++ base/linux_util.cc (working copy)
@@ -104,8 +104,10 @@
if (env->Getenv("DESKTOP_SESSION", &desktop_session)) {
if (desktop_session == "gnome")
return DESKTOP_ENVIRONMENT_GNOME;
- else if (desktop_session.substr(3) == "kde") // kde3 or kde4
- return DESKTOP_ENVIRONMENT_KDE;
+ else if (desktop_session == "kde4")
+ return DESKTOP_ENVIRONMENT_KDE4;
+ else if (desktop_session == "kde")
+ return DESKTOP_ENVIRONMENT_KDE3;
}
// Fall back on some older environment variables.
@@ -114,10 +116,30 @@
if (env->Getenv("GNOME_DESKTOP_SESSION_ID", &dummy)) {
return DESKTOP_ENVIRONMENT_GNOME;
} else if (env->Getenv("KDE_FULL_SESSION", &dummy)) {
- return DESKTOP_ENVIRONMENT_KDE;
+ if (env->Getenv("KDE_SESSION_VERSION", &dummy))
+ return DESKTOP_ENVIRONMENT_KDE4;
+ return DESKTOP_ENVIRONMENT_KDE3;
}
return DESKTOP_ENVIRONMENT_OTHER;
}
+const char* GetDesktopEnvironmentName(DesktopEnvironment env) {
+ switch (env) {
+ case DESKTOP_ENVIRONMENT_OTHER:
+ return NULL;
+ case DESKTOP_ENVIRONMENT_GNOME:
+ return "GNOME";
+ case DESKTOP_ENVIRONMENT_KDE3:
+ return "KDE3";
+ case DESKTOP_ENVIRONMENT_KDE4:
+ return "KDE4";
+ }
+ return NULL;
+}
+
+const char* GetDesktopEnvironmentName(EnvironmentVariableGetter* env) {
+ return GetDesktopEnvironmentName(GetDesktopEnvironment(env));
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698