diff options
author | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 23:14:57 +0000 |
---|---|---|
committer | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 23:14:57 +0000 |
commit | c85cfbd98c6bf26e730fdd15538c624cb52352e9 (patch) | |
tree | 55c7af76f8cfcd1cccee33ebdc5e087543d938fc /base/linux_util.cc | |
parent | 11783f0ab7285b59c4fd40c42bbbf74fcea916e4 (diff) | |
download | chromium_src-c85cfbd98c6bf26e730fdd15538c624cb52352e9.zip chromium_src-c85cfbd98c6bf26e730fdd15538c624cb52352e9.tar.gz chromium_src-c85cfbd98c6bf26e730fdd15538c624cb52352e9.tar.bz2 |
Linux: make the "change proxy settings" button able to start several proxy config utilities.
Currently it still only ever starts gnome-network-properties but it is now easy to update.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/174106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/linux_util.cc')
-rw-r--r-- | base/linux_util.cc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/base/linux_util.cc b/base/linux_util.cc index 259899f..7bdab94 100644 --- a/base/linux_util.cc +++ b/base/linux_util.cc @@ -104,8 +104,10 @@ DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env) { 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 @@ DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env) { 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 |