| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_LINUX_UTIL_H__ | 5 #ifndef BASE_LINUX_UTIL_H__ |
| 6 #define BASE_LINUX_UTIL_H__ | 6 #define BASE_LINUX_UTIL_H__ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 virtual ~EnvironmentVariableGetter() {} | 26 virtual ~EnvironmentVariableGetter() {} |
| 27 // Gets an environment variable's value and stores it in | 27 // Gets an environment variable's value and stores it in |
| 28 // result. Returns false if the key is unset. | 28 // result. Returns false if the key is unset. |
| 29 virtual bool Getenv(const char* variable_name, std::string* result) = 0; | 29 virtual bool Getenv(const char* variable_name, std::string* result) = 0; |
| 30 | 30 |
| 31 // Create an instance of EnvironmentVariableGetter | 31 // Create an instance of EnvironmentVariableGetter |
| 32 static EnvironmentVariableGetter* Create(); | 32 static EnvironmentVariableGetter* Create(); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // Return true if we appear to be running under Gnome and should attempt to use | 35 enum DesktopEnvironment { |
| 36 // some prefrences from the desktop environment (eg proxy settings), | 36 DESKTOP_ENVIRONMENT_OTHER, |
| 37 // If someone adds support for other environments, this function could be | 37 DESKTOP_ENVIRONMENT_GNOME, |
| 38 // replaced with one that returns an enum so we an specify Gnome, KDE, etc. | 38 DESKTOP_ENVIRONMENT_KDE, |
| 39 bool UseGnomeForSettings(EnvironmentVariableGetter* env_var_getter); | 39 }; |
| 40 |
| 41 // Return an entry from the DesktopEnvironment enum with a best guess |
| 42 // of which desktop environment we're using. We use this to know when |
| 43 // to attempt to use preferences from the desktop environment -- |
| 44 // proxy settings, password manager, etc. |
| 45 DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env); |
| 40 | 46 |
| 41 } // namespace base | 47 } // namespace base |
| 42 | 48 |
| 43 #endif // BASE_LINUX_UTIL_H__ | 49 #endif // BASE_LINUX_UTIL_H__ |
| OLD | NEW |