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 3 // found in the LICENSE file. 4 5 #include "chrome/common/chrome_constants.h" 6 7 #include "base/files/file_path.h" 8 9 #define FPL FILE_PATH_LITERAL 10 11 #if defined(OS_MACOSX) 12 #define CHROMIUM_PRODUCT_STRING "Chromium" 13 #if defined(GOOGLE_CHROME_BUILD) 14 #define PRODUCT_STRING "Google Chrome" 15 #elif defined(CHROMIUM_BUILD) 16 #define PRODUCT_STRING "Chromium" 17 #else 18 #error Unknown branding 19 #endif 20 #endif // defined(OS_MACOSX) 21 22 #if defined(OS_WIN) 23 #if defined(GOOGLE_CHROME_BUILD) 24 #define PRODUCT_STRING_PATH L"Google\\Chrome" 25 #elif defined(CHROMIUM_BUILD) 26 #define PRODUCT_STRING_PATH L"Chromium" 27 #else 28 #error Unknown branding 29 #endif 30 #endif // defined(OS_WIN) 31 32 namespace chrome { 33 34 const char kChromeVersionEnvVar[] = "CHROME_VERSION"; 35 36 // The following should not be used for UI strings; they are meant 37 // for system strings only. UI changes should be made in the GRD. 38 // 39 // There are four constants used to locate the executable name and path: 40 // 41 // kBrowserProcessExecutableName 42 // kHelperProcessExecutableName 43 // kBrowserProcessExecutablePath 44 // kHelperProcessExecutablePath 45 // 46 // In one condition, our tests will be built using the Chrome branding 47 // though we want to actually execute a Chromium branded application. 48 // This happens for the reference build on Mac. To support that case, 49 // we also include a Chromium version of each of the four constants and 50 // in the UITest class we support switching to that version when told to 51 // do so. 52 53 #if defined(OS_WIN) 54 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 55 FPL("chrome.exe"); 56 const base::FilePath::CharType kBrowserProcessExecutableName[] = 57 FPL("chrome.exe"); 58 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 59 FPL("chrome.exe"); 60 const base::FilePath::CharType kHelperProcessExecutableName[] = 61 FPL("chrome.exe"); 62 #elif defined(OS_MACOSX) 63 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 64 FPL(CHROMIUM_PRODUCT_STRING); 65 const base::FilePath::CharType kBrowserProcessExecutableName[] = 66 FPL(PRODUCT_STRING); 67 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 68 FPL(CHROMIUM_PRODUCT_STRING " Helper"); 69 const base::FilePath::CharType kHelperProcessExecutableName[] = 70 FPL(PRODUCT_STRING " Helper"); 71 #elif defined(OS_ANDROID) 72 // NOTE: Keep it synced with the process names defined in AndroidManifest.xml. 73 const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); 74 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 75 FPL(""); 76 const base::FilePath::CharType kHelperProcessExecutableName[] = 77 FPL("sandboxed_process"); 78 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = FPL(""); 79 #elif defined(OS_POSIX) 80 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 81 FPL("chrome"); 82 const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); 83 // Helper processes end up with a name of "exe" due to execing via 84 // /proc/self/exe. See bug 22703. 85 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 86 FPL("exe"); 87 const base::FilePath::CharType kHelperProcessExecutableName[] = FPL("exe"); 88 #endif // OS_* 89 90 #if defined(OS_WIN) 91 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 92 FPL("chrome.exe"); 93 const base::FilePath::CharType kBrowserProcessExecutablePath[] = 94 FPL("chrome.exe"); 95 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 96 FPL("chrome.exe"); 97 const base::FilePath::CharType kHelperProcessExecutablePath[] = 98 FPL("chrome.exe"); 99 #elif defined(OS_MACOSX) 100 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 101 FPL(CHROMIUM_PRODUCT_STRING ".app/Contents/MacOS/" CHROMIUM_PRODUCT_STRING); 102 const base::FilePath::CharType kBrowserProcessExecutablePath[] = 103 FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING); 104 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 105 FPL(CHROMIUM_PRODUCT_STRING " Helper.app/Contents/MacOS/" 106 CHROMIUM_PRODUCT_STRING " Helper"); 107 const base::FilePath::CharType kHelperProcessExecutablePath[] = 108 FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper"); 109 #elif defined(OS_ANDROID) 110 const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); 111 const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); 112 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 113 FPL("chrome"); 114 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 115 FPL("chrome"); 116 #elif defined(OS_POSIX) 117 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 118 FPL("chrome"); 119 const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); 120 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 121 FPL("chrome"); 122 const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); 123 #endif // OS_* 124 125 #if defined(OS_MACOSX) 126 const base::FilePath::CharType kFrameworkName[] = 127 FPL(PRODUCT_STRING " Framework.framework"); 128 129 const char* const kHelperFlavorSuffixes[] = { 130 FPL("EH"), // Executable heap 131 FPL("NP"), // No PIE 132 NULL 133 }; 134 #endif // OS_MACOSX 135 136 #if defined(OS_WIN) 137 const base::FilePath::CharType kMetroDriverDll[] = FPL("metro_driver.dll"); 138 const wchar_t kStatusTrayWindowClass[] = L"Chrome_StatusTrayWindow"; 139 #endif // defined(OS_WIN) 140 141 const wchar_t kCrashReportLog[] = L"Reported Crashes.txt"; 142 const wchar_t kTestingInterfaceDLL[] = L"testing_interface.dll"; 143 const char kInitialProfile[] = "Default"; 144 const char kMultiProfileDirPrefix[] = "Profile "; 145 const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile"); 146 const wchar_t kBrowserResourcesDll[] = L"chrome.dll"; 147 148 // filenames 149 #if defined(OS_ANDROID) 150 const base::FilePath::CharType kAndroidCacheFilename[] = FPL("AndroidCache"); 151 #endif 152 const base::FilePath::CharType kArchivedHistoryFilename[] = 153 FPL("Archived History"); 154 const base::FilePath::CharType kBookmarksFileName[] = FPL("Bookmarks"); 155 const base::FilePath::CharType kCacheDirname[] = FPL("Cache"); 156 const base::FilePath::CharType kCookieFilename[] = FPL("Cookies"); 157 const base::FilePath::CharType kCRLSetFilename[] = 158 FPL("Certificate Revocation Lists"); 159 const base::FilePath::CharType kCustomDictionaryFileName[] = 160 FPL("Custom Dictionary.txt"); 161 const base::FilePath::CharType kExtensionActivityLogFilename[] = 162 FPL("Extension Activity"); 163 const base::FilePath::CharType kExtensionsCookieFilename[] = 164 FPL("Extension Cookies"); 165 const base::FilePath::CharType kFaviconsFilename[] = FPL("Favicons"); 166 const base::FilePath::CharType kFirstRunSentinel[] = FPL("First Run"); 167 const base::FilePath::CharType kHistoryFilename[] = FPL("History"); 168 const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); 169 const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State"); 170 const base::FilePath::CharType kLocalStorePoolName[] = FPL("LocalStorePool"); 171 const base::FilePath::CharType kLoginDataFileName[] = FPL("Login Data"); 172 const base::FilePath::CharType kManagedModePolicyFilename[] = 173 FPL("Managed Mode Settings"); 174 const base::FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache"); 175 const base::FilePath::CharType kNewTabThumbnailsFilename[] = 176 FPL("Top Thumbnails"); 177 const base::FilePath::CharType kOBCertFilename[] = FPL("Origin Bound Certs"); 178 const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences"); 179 const base::FilePath::CharType kReadmeFilename[] = FPL("README"); 180 const base::FilePath::CharType kSafeBrowsingBaseFilename[] = 181 FPL("Safe Browsing"); 182 const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State"); 183 const base::FilePath::CharType kShortcutsDatabaseName[] = FPL("Shortcuts"); 184 const base::FilePath::CharType kSingletonCookieFilename[] = 185 FPL("SingletonCookie"); 186 const base::FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock"); 187 const base::FilePath::CharType kSingletonSocketFilename[] = 188 FPL("SingletonSocket"); 189 const base::FilePath::CharType kSyncCredentialsFilename[] = 190 FPL("Sync Credentials"); 191 const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak"); 192 const base::FilePath::CharType kThumbnailsFilename[] = FPL("Thumbnails"); 193 const base::FilePath::CharType kTopSitesFilename[] = FPL("Top Sites"); 194 const base::FilePath::CharType kWebAppDirname[] = FPL("Web Applications"); 195 196 // File name of the Pepper Flash plugin on different platforms. 197 const base::FilePath::CharType kPepperFlashPluginFilename[] = 198 #if defined(OS_MACOSX) 199 FPL("PepperFlashPlayer.plugin"); 200 #elif defined(OS_WIN) 201 FPL("pepflashplayer.dll"); 202 #else // OS_LINUX, etc. 203 FPL("libpepflashplayer.so"); 204 #endif 205 206 // directory names 207 const wchar_t kUserDataDirname[] = L"User Data"; 208 209 // We don't enable record mode in the released product because users could 210 // potentially be tricked into running a product in record mode without 211 // knowing it. Enable in debug builds. Playback mode is allowed always, 212 // because it is useful for testing and not hazardous by itself. 213 #ifndef NDEBUG 214 // const bool kRecordModeEnabled = true; 215 #else 216 // const bool kRecordModeEnabled = false; 217 #endif 218 219 const bool kRecordModeEnabled = true; 220 221 const char* const kUnknownLanguageCode = "und"; 222 223 const int kJavaScriptMessageExpectedDelay = 1000; 224 225 #if defined(OS_ANDROID) 226 const bool kEnableTouchIcon = true; 227 #else 228 const bool kEnableTouchIcon = false; 229 #endif 230 231 const float kMaxShareOfExtensionProcesses = 0.30f; 232 233 #if defined(OS_LINUX) 234 const int kLowestRendererOomScore = 300; 235 const int kHighestRendererOomScore = 1000; 236 #endif 237 238 #if defined(OS_WIN) 239 // This is used by the PreRead experiment. 240 const char kPreReadEnvironmentVariable[] = "CHROME_PRE_READ_EXPERIMENT"; 241 // This is used by chrome in Windows 8 metro mode. 242 const wchar_t kMetroChromeUserDataSubDir[] = L"Metro"; 243 const wchar_t kMetroNavigationAndSearchMessage[] = 244 L"CHROME_METRO_NAV_SEARCH_REQUEST"; 245 const wchar_t kMetroGetCurrentTabInfoMessage[] = 246 L"CHROME_METRO_GET_CURRENT_TAB_INFO"; 247 const wchar_t kMetroRegistryPath[] = 248 L"Software\\" PRODUCT_STRING_PATH L"\\Metro"; 249 const wchar_t kLaunchModeValue[] = L"launch_mode"; 250 #endif 251 252 #if defined(OS_CHROMEOS) 253 const char kProfileDirPrefix[] = "u-"; 254 #endif 255 256 // This GUID is associated with any 'don't ask me again' settings that the 257 // user can select for different file types. 258 // {2676A9A2-D919-4FEE-9187-152100393AB2} 259 const char kApplicationClientIDStringForAVScanning[] = 260 "2676A9A2-D919-4FEE-9187-152100393AB2"; 261 262 } // namespace chrome 263 264 #undef FPL 265