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.
5 #include "chrome/common/chrome_constants.h"
7 #include "base/files/file_path.h"
9 #define FPL FILE_PATH_LITERAL
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"
18 #error Unknown branding
20 #endif // defined(OS_MACOSX)
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"
28 #error Unknown branding
30 #endif // defined(OS_WIN)
34 const char kChromeVersionEnvVar
[] = "CHROME_VERSION";
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.
39 // There are four constants used to locate the executable name and path:
41 // kBrowserProcessExecutableName
42 // kHelperProcessExecutableName
43 // kBrowserProcessExecutablePath
44 // kHelperProcessExecutablePath
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
54 const base::FilePath::CharType kBrowserProcessExecutableNameChromium
[] =
56 const base::FilePath::CharType kBrowserProcessExecutableName
[] =
58 const base::FilePath::CharType kHelperProcessExecutableNameChromium
[] =
60 const base::FilePath::CharType kHelperProcessExecutableName
[] =
62 #elif defined(OS_MACOSX)
63 const base::FilePath::CharType kBrowserProcessExecutableNameChromium
[] =
64 FPL(CHROMIUM_PRODUCT_STRING
);
65 const base::FilePath::CharType kBrowserProcessExecutableName
[] =
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
[] =
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
[] =
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
[] =
87 const base::FilePath::CharType kHelperProcessExecutableName
[] = FPL("exe");
91 const base::FilePath::CharType kBrowserProcessExecutablePathChromium
[] =
93 const base::FilePath::CharType kBrowserProcessExecutablePath
[] =
95 const base::FilePath::CharType kHelperProcessExecutablePathChromium
[] =
97 const base::FilePath::CharType kHelperProcessExecutablePath
[] =
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
[] =
114 const base::FilePath::CharType kHelperProcessExecutablePathChromium
[] =
116 #elif defined(OS_POSIX)
117 const base::FilePath::CharType kBrowserProcessExecutablePathChromium
[] =
119 const base::FilePath::CharType kBrowserProcessExecutablePath
[] = FPL("chrome");
120 const base::FilePath::CharType kHelperProcessExecutablePathChromium
[] =
122 const base::FilePath::CharType kHelperProcessExecutablePath
[] = FPL("chrome");
125 #if defined(OS_MACOSX)
126 const base::FilePath::CharType kFrameworkName
[] =
127 FPL(PRODUCT_STRING
" Framework.framework");
129 const char* const kHelperFlavorSuffixes
[] = {
130 FPL("EH"), // Executable heap
137 const base::FilePath::CharType kMetroDriverDll
[] = FPL("metro_driver.dll");
138 const wchar_t kStatusTrayWindowClass
[] = L
"Chrome_StatusTrayWindow";
139 #endif // defined(OS_WIN)
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";
149 #if defined(OS_ANDROID)
150 const base::FilePath::CharType kAndroidCacheFilename
[] = FPL("AndroidCache");
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 kCLDDataFilename
[] =
160 FPL("cld2_data.bin");
161 const base::FilePath::CharType kCustomDictionaryFileName
[] =
162 FPL("Custom Dictionary.txt");
163 const base::FilePath::CharType kExtensionActivityLogFilename
[] =
164 FPL("Extension Activity");
165 const base::FilePath::CharType kExtensionsCookieFilename
[] =
166 FPL("Extension Cookies");
167 const base::FilePath::CharType kFaviconsFilename
[] = FPL("Favicons");
168 const base::FilePath::CharType kFirstRunSentinel
[] = FPL("First Run");
169 const base::FilePath::CharType kGCMStoreDirname
[] = FPL("GCM Store");
170 const base::FilePath::CharType kHistoryFilename
[] = FPL("History");
171 const base::FilePath::CharType kJumpListIconDirname
[] = FPL("JumpListIcons");
172 const base::FilePath::CharType kLocalStateFilename
[] = FPL("Local State");
173 const base::FilePath::CharType kLocalStorePoolName
[] = FPL("LocalStorePool");
174 const base::FilePath::CharType kLoginDataFileName
[] = FPL("Login Data");
175 const base::FilePath::CharType kManagedUserSettingsFilename
[] =
176 FPL("Managed Mode Settings");
177 const base::FilePath::CharType kMediaCacheDirname
[] = FPL("Media Cache");
178 const base::FilePath::CharType kNewTabThumbnailsFilename
[] =
179 FPL("Top Thumbnails");
180 const base::FilePath::CharType kOBCertFilename
[] = FPL("Origin Bound Certs");
181 const base::FilePath::CharType kPreferencesFilename
[] = FPL("Preferences");
182 const base::FilePath::CharType kReadmeFilename
[] = FPL("README");
183 const base::FilePath::CharType kResetPromptMementoFilename
[] =
184 FPL("Reset Prompt Memento");
185 const base::FilePath::CharType kSafeBrowsingBaseFilename
[] =
186 FPL("Safe Browsing");
187 const base::FilePath::CharType kServiceStateFileName
[] = FPL("Service State");
188 const base::FilePath::CharType kShortcutsDatabaseName
[] = FPL("Shortcuts");
189 const base::FilePath::CharType kSingletonCookieFilename
[] =
190 FPL("SingletonCookie");
191 const base::FilePath::CharType kSingletonLockFilename
[] = FPL("SingletonLock");
192 const base::FilePath::CharType kSingletonSocketFilename
[] =
193 FPL("SingletonSocket");
194 const base::FilePath::CharType kSyncCredentialsFilename
[] =
195 FPL("Sync Credentials");
196 const base::FilePath::CharType kThemePackFilename
[] = FPL("Cached Theme.pak");
197 const base::FilePath::CharType kThumbnailsFilename
[] = FPL("Thumbnails");
198 const base::FilePath::CharType kTopSitesFilename
[] = FPL("Top Sites");
199 const base::FilePath::CharType kWebAppDirname
[] = FPL("Web Applications");
201 // File name of the Pepper Flash plugin on different platforms.
202 const base::FilePath::CharType kPepperFlashPluginFilename
[] =
203 #if defined(OS_MACOSX)
204 FPL("PepperFlashPlayer.plugin");
205 #elif defined(OS_WIN)
206 FPL("pepflashplayer.dll");
207 #else // OS_LINUX, etc.
208 FPL("libpepflashplayer.so");
212 const wchar_t kUserDataDirname
[] = L
"User Data";
214 // We don't enable record mode in the released product because users could
215 // potentially be tricked into running a product in record mode without
216 // knowing it. Enable in debug builds. Playback mode is allowed always,
217 // because it is useful for testing and not hazardous by itself.
219 // const bool kRecordModeEnabled = true;
221 // const bool kRecordModeEnabled = false;
224 const bool kRecordModeEnabled
= true;
226 const int kJavaScriptMessageExpectedDelay
= 1000;
228 #if defined(OS_ANDROID)
229 const bool kEnableTouchIcon
= true;
231 const bool kEnableTouchIcon
= false;
234 const float kMaxShareOfExtensionProcesses
= 0.30f
;
236 // This is used by the PreRead experiment.
237 const char kPreReadEnvironmentVariable
[] = "CHROME_PRE_READ_EXPERIMENT";
239 #if defined(OS_LINUX)
240 const int kLowestRendererOomScore
= 300;
241 const int kHighestRendererOomScore
= 1000;
245 // This is used by chrome in Windows 8 metro mode.
246 const wchar_t kMetroChromeUserDataSubDir
[] = L
"Metro";
247 const wchar_t kMetroNavigationAndSearchMessage
[] =
248 L
"CHROME_METRO_NAV_SEARCH_REQUEST";
249 const wchar_t kMetroGetCurrentTabInfoMessage
[] =
250 L
"CHROME_METRO_GET_CURRENT_TAB_INFO";
251 const wchar_t kMetroRegistryPath
[] =
252 L
"Software\\" PRODUCT_STRING_PATH L
"\\Metro";
253 const wchar_t kLaunchModeValue
[] = L
"launch_mode";
254 // This is used by breakpad and the metrics reporting.
255 const wchar_t kBrowserCrashDumpAttemptsRegistryPath
[] =
256 L
"Software\\" PRODUCT_STRING_PATH L
"\\BrowserCrashDumpAttempts";
257 const char kSafeModeEnvVar
[] = "CHROME_SAFE_MODE";
260 #if defined(OS_CHROMEOS)
261 const char kProfileDirPrefix
[] = "u-";
262 const char kLegacyProfileDir
[] = "user";
263 const char kTestUserProfileDir
[] = "test-user";
266 // This GUID is associated with any 'don't ask me again' settings that the
267 // user can select for different file types.
268 // {2676A9A2-D919-4FEE-9187-152100393AB2}
269 const char kApplicationClientIDStringForAVScanning
[] =
270 "2676A9A2-D919-4FEE-9187-152100393AB2";
272 #if defined(OS_ANDROID)
273 const size_t kMaxMetaTagAttributeLength
= 2000;
276 } // namespace chrome