| 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 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env, | 54 FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env, |
| 55 const char* dir_name, const char* fallback_dir); | 55 const char* dir_name, const char* fallback_dir); |
| 56 | 56 |
| 57 enum DesktopEnvironment { | 57 enum DesktopEnvironment { |
| 58 DESKTOP_ENVIRONMENT_OTHER, | 58 DESKTOP_ENVIRONMENT_OTHER, |
| 59 DESKTOP_ENVIRONMENT_GNOME, | 59 DESKTOP_ENVIRONMENT_GNOME, |
| 60 // KDE3 and KDE4 are sufficiently different that we count | 60 // KDE3 and KDE4 are sufficiently different that we count |
| 61 // them as two different desktop environments here. | 61 // them as two different desktop environments here. |
| 62 DESKTOP_ENVIRONMENT_KDE3, | 62 DESKTOP_ENVIRONMENT_KDE3, |
| 63 DESKTOP_ENVIRONMENT_KDE4, | 63 DESKTOP_ENVIRONMENT_KDE4, |
| 64 DESKTOP_ENVIRONMENT_XFCE, |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 // Return an entry from the DesktopEnvironment enum with a best guess | 67 // Return an entry from the DesktopEnvironment enum with a best guess |
| 67 // of which desktop environment we're using. We use this to know when | 68 // of which desktop environment we're using. We use this to know when |
| 68 // to attempt to use preferences from the desktop environment -- | 69 // to attempt to use preferences from the desktop environment -- |
| 69 // proxy settings, password manager, etc. | 70 // proxy settings, password manager, etc. |
| 70 DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env); | 71 DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env); |
| 71 | 72 |
| 72 // Return a string representation of the given desktop environment. | 73 // Return a string representation of the given desktop environment. |
| 73 // May return NULL in the case of DESKTOP_ENVIRONMENT_OTHER. | 74 // May return NULL in the case of DESKTOP_ENVIRONMENT_OTHER. |
| 74 const char* GetDesktopEnvironmentName(DesktopEnvironment env); | 75 const char* GetDesktopEnvironmentName(DesktopEnvironment env); |
| 75 // Convenience wrapper that calls GetDesktopEnvironment() first. | 76 // Convenience wrapper that calls GetDesktopEnvironment() first. |
| 76 const char* GetDesktopEnvironmentName(EnvironmentVariableGetter* env); | 77 const char* GetDesktopEnvironmentName(EnvironmentVariableGetter* env); |
| 77 | 78 |
| 78 // Return the inode number for the UNIX domain socket |fd|. | 79 // Return the inode number for the UNIX domain socket |fd|. |
| 79 bool FileDescriptorGetInode(ino_t* inode_out, int fd); | 80 bool FileDescriptorGetInode(ino_t* inode_out, int fd); |
| 80 | 81 |
| 81 // Find the process which holds the given socket, named by inode number. If | 82 // Find the process which holds the given socket, named by inode number. If |
| 82 // multiple processes hold the socket, this function returns false. | 83 // multiple processes hold the socket, this function returns false. |
| 83 bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode); | 84 bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode); |
| 84 | 85 |
| 85 } // namespace base | 86 } // namespace base |
| 86 | 87 |
| 87 #endif // BASE_LINUX_UTIL_H__ | 88 #endif // BASE_LINUX_UTIL_H__ |
| OLD | NEW |