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