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

Unified Diff: base/linux_util.h

Issue 155792: Try again: Add proxy config (using gnome-network-preferences) (Closed)
Patch Set: nits fixed Created 11 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 | « no previous file | base/linux_util.cc » ('j') | net/proxy/proxy_config_service_linux.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/linux_util.h
diff --git a/base/linux_util.h b/base/linux_util.h
index 973a2b0dc64e0c8ed1f6d87eeceacc0c70482298..5a4648145d77e4d80ec7e34883fa76a4a2d4fea3 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__
« no previous file with comments | « no previous file | base/linux_util.cc » ('j') | net/proxy/proxy_config_service_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698