OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYS_INFO_H_ | 5 #ifndef BASE_SYS_INFO_H_ |
6 #define BASE_SYS_INFO_H_ | 6 #define BASE_SYS_INFO_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 static bool GetLsbReleaseValue(const std::string& key, std::string* value); | 89 static bool GetLsbReleaseValue(const std::string& key, std::string* value); |
90 | 90 |
91 // Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...). | 91 // Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...). |
92 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. | 92 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. |
93 static std::string GetLsbReleaseBoard(); | 93 static std::string GetLsbReleaseBoard(); |
94 | 94 |
95 // Returns the creation time of /etc/lsb-release. (Used to get the date and | 95 // Returns the creation time of /etc/lsb-release. (Used to get the date and |
96 // time of the Chrome OS build). | 96 // time of the Chrome OS build). |
97 static Time GetLsbReleaseTime(); | 97 static Time GetLsbReleaseTime(); |
98 | 98 |
| 99 // Returns true when actually running in a Chrome OS environment. |
| 100 static bool IsRunningOnChromeOS(); |
| 101 |
99 // Test method to force re-parsing of lsb-release. | 102 // Test method to force re-parsing of lsb-release. |
100 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, | 103 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, |
101 const Time& lsb_release_time); | 104 const Time& lsb_release_time); |
102 #endif // defined(OS_CHROMEOS) | 105 #endif // defined(OS_CHROMEOS) |
103 | 106 |
104 #if defined(OS_ANDROID) | 107 #if defined(OS_ANDROID) |
105 // Returns the Android build's codename. | 108 // Returns the Android build's codename. |
106 static std::string GetAndroidBuildCodename(); | 109 static std::string GetAndroidBuildCodename(); |
107 | 110 |
108 // Returns the Android build ID. | 111 // Returns the Android build ID. |
109 static std::string GetAndroidBuildID(); | 112 static std::string GetAndroidBuildID(); |
110 | 113 |
111 // Returns the device's name. | 114 // Returns the device's name. |
112 static std::string GetDeviceName(); | 115 static std::string GetDeviceName(); |
113 | 116 |
114 static int DalvikHeapSizeMB(); | 117 static int DalvikHeapSizeMB(); |
115 static int DalvikHeapGrowthLimitMB(); | 118 static int DalvikHeapGrowthLimitMB(); |
116 #endif // defined(OS_ANDROID) | 119 #endif // defined(OS_ANDROID) |
117 }; | 120 }; |
118 | 121 |
119 } // namespace base | 122 } // namespace base |
120 | 123 |
121 #endif // BASE_SYS_INFO_H_ | 124 #endif // BASE_SYS_INFO_H_ |
OLD | NEW |