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 "build/branding_buildflags.h" 8 #include "build/build_config.h" 9 #include "chrome/common/chrome_version.h" 10 11 #define FPL FILE_PATH_LITERAL 12 13 #if defined(OS_MAC) 14 #define CHROMIUM_PRODUCT_STRING "Chromium" 15 #if BUILDFLAG(GOOGLE_CHROME_BRANDING) 16 #define PRODUCT_STRING "Google Chrome" 17 #elif BUILDFLAG(CHROMIUM_BRANDING) 18 #define PRODUCT_STRING "Chromium" 19 #else 20 #error Unknown branding 21 #endif 22 #endif // defined(OS_MAC) 23 24 namespace chrome { 25 26 const char kChromeVersion[] = CHROME_VERSION_STRING; 27 28 // The following should not be used for UI strings; they are meant 29 // for system strings only. UI changes should be made in the GRD. 30 // 31 // There are four constants used to locate the executable name and path: 32 // 33 // kBrowserProcessExecutableName 34 // kHelperProcessExecutableName 35 // kBrowserProcessExecutablePath 36 // kHelperProcessExecutablePath 37 // 38 // In one condition, our tests will be built using the Chrome branding 39 // though we want to actually execute a Chromium branded application. 40 // This happens for the reference build on Mac. To support that case, 41 // we also include a Chromium version of each of the four constants and 42 // in the UITest class we support switching to that version when told to 43 // do so. 44 45 #if defined(OS_WIN) 46 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 47 FPL("chrome.exe"); 48 const base::FilePath::CharType kBrowserProcessExecutableName[] = 49 FPL("chrome.exe"); 50 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 51 FPL("chrome.exe"); 52 const base::FilePath::CharType kHelperProcessExecutableName[] = 53 FPL("chrome.exe"); 54 #elif defined(OS_MAC) 55 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 56 FPL(CHROMIUM_PRODUCT_STRING); 57 const base::FilePath::CharType kBrowserProcessExecutableName[] = 58 FPL(PRODUCT_STRING); 59 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 60 FPL(CHROMIUM_PRODUCT_STRING " Helper"); 61 const base::FilePath::CharType kHelperProcessExecutableName[] = 62 FPL(PRODUCT_STRING " Helper"); 63 #elif defined(OS_ANDROID) 64 // NOTE: Keep it synced with the process names defined in AndroidManifest.xml. 65 const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); 66 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 67 FPL(""); 68 const base::FilePath::CharType kHelperProcessExecutableName[] = 69 FPL("sandboxed_process"); 70 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = FPL(""); 71 #elif defined(OS_POSIX) 72 const base::FilePath::CharType kBrowserProcessExecutableNameChromium[] = 73 FPL("chrome"); 74 const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); 75 // Helper processes end up with a name of "exe" due to execing via 76 // /proc/self/exe. See bug 22703. 77 const base::FilePath::CharType kHelperProcessExecutableNameChromium[] = 78 FPL("exe"); 79 const base::FilePath::CharType kHelperProcessExecutableName[] = FPL("exe"); 80 #endif // OS_* 81 82 #if defined(OS_WIN) 83 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 84 FPL("chrome.exe"); 85 const base::FilePath::CharType kBrowserProcessExecutablePath[] = 86 FPL("chrome.exe"); 87 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 88 FPL("chrome.exe"); 89 const base::FilePath::CharType kHelperProcessExecutablePath[] = 90 FPL("chrome.exe"); 91 #elif defined(OS_MAC) 92 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 93 FPL(CHROMIUM_PRODUCT_STRING ".app/Contents/MacOS/" CHROMIUM_PRODUCT_STRING); 94 const base::FilePath::CharType kBrowserProcessExecutablePath[] = 95 FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING); 96 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 97 FPL(CHROMIUM_PRODUCT_STRING 98 " Helper.app/Contents/MacOS/" CHROMIUM_PRODUCT_STRING " Helper"); 99 const base::FilePath::CharType kHelperProcessExecutablePath[] = 100 FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper"); 101 #elif defined(OS_ANDROID) 102 const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); 103 const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); 104 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 105 FPL("chrome"); 106 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 107 FPL("chrome"); 108 #elif defined(OS_POSIX) 109 const base::FilePath::CharType kBrowserProcessExecutablePathChromium[] = 110 FPL("chrome"); 111 const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); 112 const base::FilePath::CharType kHelperProcessExecutablePathChromium[] = 113 FPL("chrome"); 114 const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); 115 #endif // OS_* 116 117 #if defined(OS_MAC) 118 const base::FilePath::CharType kFrameworkName[] = 119 FPL(PRODUCT_STRING " Framework.framework"); 120 const base::FilePath::CharType kFrameworkExecutableName[] = 121 FPL(PRODUCT_STRING " Framework"); 122 #endif // OS_MAC 123 124 #if defined(OS_WIN) 125 const base::FilePath::CharType kBrowserResourcesDll[] = FPL("chrome.dll"); 126 const base::FilePath::CharType kElfDll[] = FPL("chrome_elf.dll"); 127 const base::FilePath::CharType kStatusTrayWindowClass[] = 128 FPL("Chrome_StatusTrayWindow"); 129 #endif // defined(OS_WIN) 130 131 const char kInitialProfile[] = "Default"; 132 const char kMultiProfileDirPrefix[] = "Profile "; 133 const char kEphemeralGuestProfileDirPrefix[] = "Guest "; 134 const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile"); 135 const base::FilePath::CharType kSystemProfileDir[] = FPL("System Profile"); 136 137 // filenames 138 const base::FilePath::CharType kCacheDirname[] = FPL("Cache"); 139 const base::FilePath::CharType kCookieFilename[] = FPL("Cookies"); 140 const base::FilePath::CharType kCRLSetFilename[] = 141 FPL("Certificate Revocation Lists"); 142 const base::FilePath::CharType kCustomDictionaryFileName[] = 143 FPL("Custom Dictionary.txt"); 144 const base::FilePath::CharType kDownloadServiceStorageDirname[] = 145 FPL("Download Service"); 146 const base::FilePath::CharType kExtensionActivityLogFilename[] = 147 FPL("Extension Activity"); 148 const base::FilePath::CharType kExtensionsCookieFilename[] = 149 FPL("Extension Cookies"); 150 const base::FilePath::CharType kFeatureEngagementTrackerStorageDirname[] = 151 FPL("Feature Engagement Tracker"); 152 const base::FilePath::CharType kFirstRunSentinel[] = FPL("First Run"); 153 const base::FilePath::CharType kGCMStoreDirname[] = FPL("GCM Store"); 154 const base::FilePath::CharType kHeavyAdInterventionOptOutDBFilename[] = 155 FPL("heavy_ad_intervention_opt_out.db"); 156 const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State"); 157 const base::FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache"); 158 const base::FilePath::CharType kNetworkPersistentStateFilename[] = 159 FPL("Network Persistent State"); 160 const base::FilePath::CharType kNotificationSchedulerStorageDirname[] = 161 FPL("Notification Scheduler"); 162 const base::FilePath::CharType kOfflinePageArchivesDirname[] = 163 FPL("Offline Pages/archives"); 164 const base::FilePath::CharType kOfflinePageMetadataDirname[] = 165 FPL("Offline Pages/metadata"); 166 const base::FilePath::CharType kOfflinePagePrefetchStoreDirname[] = 167 FPL("Offline Pages/prefech_store"); 168 const base::FilePath::CharType kOfflinePageRequestQueueDirname[] = 169 FPL("Offline Pages/request_queue"); 170 const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences"); 171 const base::FilePath::CharType kPreviewsOptOutDBFilename[] = 172 FPL("previews_opt_out.db"); 173 const base::FilePath::CharType kQueryTileStorageDirname[] = FPL("Query Tiles"); 174 const base::FilePath::CharType kVideoTutorialsStorageDirname[] = 175 FPL("Video Tutorials"); 176 const base::FilePath::CharType kReadmeFilename[] = FPL("README"); 177 const base::FilePath::CharType kSecurePreferencesFilename[] = 178 FPL("Secure Preferences"); 179 const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State"); 180 const base::FilePath::CharType kSingletonCookieFilename[] = 181 FPL("SingletonCookie"); 182 const base::FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock"); 183 const base::FilePath::CharType kSingletonSocketFilename[] = 184 FPL("SingletonSocket"); 185 const base::FilePath::CharType kSupervisedUserSettingsFilename[] = 186 FPL("Managed Mode Settings"); 187 const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak"); 188 const base::FilePath::CharType kTrustTokenFilename[] = FPL("Trust Tokens"); 189 const base::FilePath::CharType kWebAppDirname[] = FPL("Web Applications"); 190 // Only use if the ENABLE_REPORTING build flag is true 191 const base::FilePath::CharType kReportingAndNelStoreFilename[] = 192 FPL("Reporting and NEL"); 193 194 #if defined(OS_WIN) 195 const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); 196 #endif 197 198 // directory names 199 #if defined(OS_WIN) 200 const wchar_t kUserDataDirname[] = L"User Data"; 201 #endif 202 203 const float kMaxShareOfExtensionProcesses = 0.30f; 204 205 #if defined(OS_CHROMEOS) 206 const char kProfileDirPrefix[] = "u-"; 207 const char kLegacyProfileDir[] = "user"; 208 const char kTestUserProfileDir[] = "test-user"; 209 const char kLockScreenAppProfile[] = "LockScreenAppsProfile"; 210 #endif 211 212 // This GUID is associated with any 'don't ask me again' settings that the 213 // user can select for different file types. 214 // {2676A9A2-D919-4FEE-9187-152100393AB2} 215 const char kApplicationClientIDStringForAVScanning[] = 216 "2676A9A2-D919-4FEE-9187-152100393AB2"; 217 218 const size_t kMaxMetaTagAttributeLength = 2000; 219 220 } // namespace chrome 221 222 #undef FPL 223