summaryrefslogtreecommitdiffstats
path: root/base/linux_util.h
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 00:22:49 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 00:22:49 +0000
commit87fc168b364ef36033f72e545a4894bd7ce9354f (patch)
tree8dd7a36186859c6b42be3156178373d91599e310 /base/linux_util.h
parentbda0b8792b40ce11649995a622344b0aa91b7a9d (diff)
downloadchromium_src-87fc168b364ef36033f72e545a4894bd7ce9354f.zip
chromium_src-87fc168b364ef36033f72e545a4894bd7ce9354f.tar.gz
chromium_src-87fc168b364ef36033f72e545a4894bd7ce9354f.tar.bz2
Try again: Add proxy config (using gnome-network-preferences)
BUG=11507 TEST=Open options, click change proxy, gnome-network-preferences should launch.  If gnome isn't installed or running, LinuxProxyConfig wiki page should load. Review URL: http://codereview.chromium.org/155792 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/linux_util.h')
-rw-r--r--base/linux_util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/linux_util.h b/base/linux_util.h
index 973a2b0..5a46481 100644
--- a/base/linux_util.h
+++ b/base/linux_util.h
@@ -20,6 +20,24 @@ uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride);
// GetWinVersion() in base/win_util.h.
std::string GetLinuxDistro();
+// These are used to derive mocks for unittests.
+class EnvironmentVariableGetter {
+ public:
+ virtual ~EnvironmentVariableGetter() {}
+ // Gets an environment variable's value and stores it in
+ // result. Returns false if the key is unset.
+ virtual bool Getenv(const char* variable_name, std::string* result) = 0;
+
+ // Create an instance of EnvironmentVariableGetter
+ static EnvironmentVariableGetter* Create();
+};
+
+// Return true if we appear to be running under Gnome and should attempt to use
+// some prefrences from the desktop environment (eg proxy settings),
+// If someone adds support for other environments, this function could be
+// replaced with one that returns an enum so we an specify Gnome, KDE, etc.
+bool UseGnomeForSettings(EnvironmentVariableGetter* env_var_getter);
+
} // namespace base
#endif // BASE_LINUX_UTIL_H__