chrome_constants.cc revision 21d179b334e59e9a3bfcaed4c4430bef1bc5759d
1// Copyright (c) 2006-2008 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/file_path.h"
8
9#define FPL FILE_PATH_LITERAL
10
11#if defined(OS_MACOSX)
12#if defined(GOOGLE_CHROME_BUILD)
13#define PRODUCT_STRING "Google Chrome"
14#elif defined(CHROMIUM_BUILD)
15#define PRODUCT_STRING "Chromium"
16#else
17#error Unknown branding
18#endif
19#endif  // OS_MACOSX
20
21namespace chrome {
22
23const char kChromeVersionEnvVar[] = "CHROME_VERSION";
24
25// The following should not be used for UI strings; they are meant
26// for system strings only. UI changes should be made in the GRD.
27#if defined(OS_WIN)
28const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome.exe");
29const FilePath::CharType kHelperProcessExecutableName[] = FPL("chrome.exe");
30#elif defined(OS_LINUX)
31const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome");
32// Helper processes end up with a name of "exe" due to execing via
33// /proc/self/exe.  See bug 22703.
34const FilePath::CharType kHelperProcessExecutableName[] = FPL("exe");
35#elif defined(OS_MACOSX)
36const FilePath::CharType kBrowserProcessExecutableName[] = FPL(PRODUCT_STRING);
37const FilePath::CharType kHelperProcessExecutableName[] =
38    FPL(PRODUCT_STRING " Helper");
39#endif  // OS_*
40#if defined(OS_WIN)
41const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome.exe");
42const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome.exe");
43#elif defined(OS_LINUX)
44const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome");
45const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome");
46#elif defined(OS_MACOSX)
47const FilePath::CharType kBrowserProcessExecutablePath[] =
48    FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING);
49const FilePath::CharType kHelperProcessExecutablePath[] =
50    FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper");
51#endif  // OS_*
52#if defined(OS_MACOSX)
53const FilePath::CharType kFrameworkName[] =
54    FPL(PRODUCT_STRING " Framework.framework");
55#endif  // OS_MACOSX
56const wchar_t kNaClAppName[] = L"nacl64";
57#if defined(GOOGLE_CHROME_BUILD)
58const wchar_t kBrowserAppName[] = L"Chrome";
59const char    kStatsFilename[] = "ChromeStats2";
60#else
61const wchar_t kBrowserAppName[] = L"Chromium";
62const char    kStatsFilename[] = "ChromiumStats2";
63#endif
64
65#if defined(OS_WIN)
66const wchar_t kStatusTrayWindowClass[] = L"Chrome_StatusTrayWindow";
67#endif  // defined(OS_WIN)
68
69const wchar_t kMessageWindowClass[] = L"Chrome_MessageWindow";
70const wchar_t kCrashReportLog[] = L"Reported Crashes.txt";
71const wchar_t kTestingInterfaceDLL[] = L"testing_interface.dll";
72const wchar_t kNotSignedInProfile[] = L"Default";
73const wchar_t kNotSignedInID[] = L"not-signed-in";
74const wchar_t kBrowserResourcesDll[] = L"chrome.dll";
75const FilePath::CharType kExtensionFileExtension[] = FPL(".crx");
76const FilePath::CharType kExtensionKeyFileExtension[] = FPL(".pem");
77
78// filenames
79const FilePath::CharType kArchivedHistoryFilename[] = FPL("Archived History");
80const FilePath::CharType kCacheDirname[] = FPL("Cache");
81const FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache");
82const FilePath::CharType kOffTheRecordMediaCacheDirname[] =
83    FPL("Incognito Media Cache");
84const FilePath::CharType kAppCacheDirname[] = FPL("Application Cache");
85const FilePath::CharType kChromePluginDataDirname[] = FPL("Plugin Data");
86const FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak");
87const FilePath::CharType kCookieFilename[] = FPL("Cookies");
88const FilePath::CharType kExtensionsCookieFilename[] = FPL("Extension Cookies");
89const FilePath::CharType kFaviconsFilename[] = FPL("Favicons");
90const FilePath::CharType kHistoryFilename[] = FPL("History");
91const FilePath::CharType kLocalStateFilename[] = FPL("Local State");
92const FilePath::CharType kPreferencesFilename[] = FPL("Preferences");
93const FilePath::CharType kSafeBrowsingBaseFilename[] = FPL("Safe Browsing");
94const FilePath::CharType kSafeBrowsingPhishingModelFilename[] =
95    FPL("Safe Browsing Phishing Model");
96const FilePath::CharType kSingletonCookieFilename[] = FPL("SingletonCookie");
97const FilePath::CharType kSingletonSocketFilename[] = FPL("SingletonSocket");
98const FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock");
99const FilePath::CharType kThumbnailsFilename[] = FPL("Thumbnails");
100const FilePath::CharType kNewTabThumbnailsFilename[] = FPL("Top Thumbnails");
101const FilePath::CharType kTopSitesFilename[] = FPL("Top Sites");
102const wchar_t kUserDataDirname[] = L"User Data";
103const FilePath::CharType kUserScriptsDirname[] = FPL("User Scripts");
104const FilePath::CharType kWebDataFilename[] = FPL("Web Data");
105const FilePath::CharType kBookmarksFileName[] = FPL("Bookmarks");
106const FilePath::CharType kHistoryBookmarksFileName[] =
107    FPL("Bookmarks From History");
108const FilePath::CharType kCustomDictionaryFileName[] =
109    FPL("Custom Dictionary.txt");
110const FilePath::CharType kLoginDataFileName[] = FPL("Login Data");
111const FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons");
112const FilePath::CharType kWebAppDirname[] = FPL("Web Applications");
113const FilePath::CharType kServiceStateFileName[] = FPL("Service State");
114
115// This number used to be limited to 32 in the past (see b/535234).
116const unsigned int kMaxRendererProcessCount = 42;
117const int kStatsMaxThreads = 32;
118const int kStatsMaxCounters = 300;
119
120const size_t kMaxTitleChars = 4 * 1024;
121const size_t kMaxURLChars = 2 * 1024 * 1024;
122const size_t kMaxURLDisplayChars = 32 * 1024;
123
124// We don't enable record mode in the released product because users could
125// potentially be tricked into running a product in record mode without
126// knowing it.  Enable in debug builds.  Playback mode is allowed always,
127// because it is useful for testing and not hazardous by itself.
128#ifndef NDEBUG
129const bool kRecordModeEnabled = true;
130#else
131const bool kRecordModeEnabled = false;
132#endif
133
134const int kHistogramSynchronizerReservedSequenceNumber = 0;
135
136const int kMaxSessionHistoryEntries = 50;
137
138const char* const kUnknownLanguageCode = "und";
139
140}  // namespace chrome
141
142#undef FPL
143