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 #ifndef EXTENSIONS_COMMON_CONSTANTS_H_
6 #define EXTENSIONS_COMMON_CONSTANTS_H_
8 #include "base/basictypes.h"
9 #include "base/files/file_path.h"
11 namespace extensions
{
13 // Scheme we serve extension content from.
14 extern const char kExtensionScheme
[];
16 // Canonical schemes you can use as input to GURL.SchemeIs().
17 extern const char kExtensionResourceScheme
[];
19 // The name of the manifest inside an extension.
20 extern const base::FilePath::CharType kManifestFilename
[];
22 // The name of locale folder inside an extension.
23 extern const base::FilePath::CharType kLocaleFolder
[];
25 // The name of the messages file inside an extension.
26 extern const base::FilePath::CharType kMessagesFilename
[];
28 // The base directory for subdirectories with platform-specific code.
29 extern const base::FilePath::CharType kPlatformSpecificFolder
[];
31 // A directory reserved for metadata, generated either by the webstore
33 extern const base::FilePath::CharType kMetadataFolder
[];
35 // Name of the verified contents file within the metadata folder.
36 extern const base::FilePath::CharType kVerifiedContentsFilename
[];
38 // Name of the computed hashes file within the metadata folder.
39 extern const base::FilePath::CharType kComputedHashesFilename
[];
41 // The name of the directory inside the profile where extensions are
43 extern const char kInstallDirectoryName
[];
45 // The name of a temporary directory to install an extension into for
46 // validation before finalizing install.
47 extern const char kTempExtensionName
[];
49 // The file to write our decoded images to, relative to the extension_path.
50 extern const char kDecodedImagesFilename
[];
52 // The file to write our decoded message catalogs to, relative to the
54 extern const char kDecodedMessageCatalogsFilename
[];
56 // The filename to use for a background page generated from
57 // background.scripts.
58 extern const char kGeneratedBackgroundPageFilename
[];
60 // Path to imported modules.
61 extern const char kModulesDir
[];
63 // The file extension (.crx) for extensions.
64 extern const base::FilePath::CharType kExtensionFileExtension
[];
66 // The file extension (.pem) for private key files.
67 extern const base::FilePath::CharType kExtensionKeyFileExtension
[];
69 // Default frequency for auto updates, if turned on.
70 extern const int kDefaultUpdateFrequencySeconds
;
72 // The name of the directory inside the profile where per-app local settings
74 extern const char kLocalAppSettingsDirectoryName
[];
76 // The name of the directory inside the profile where per-extension local
77 // settings are stored.
78 extern const char kLocalExtensionSettingsDirectoryName
[];
80 // The name of the directory inside the profile where per-app synced settings
82 extern const char kSyncAppSettingsDirectoryName
[];
84 // The name of the directory inside the profile where per-extension synced
85 // settings are stored.
86 extern const char kSyncExtensionSettingsDirectoryName
[];
88 // The name of the directory inside the profile where per-extension persistent
89 // managed settings are stored.
90 extern const char kManagedSettingsDirectoryName
[];
92 // The name of the database inside the profile where chrome-internal
93 // extension state resides.
94 extern const char kStateStoreName
[];
96 // The name of the database inside the profile where declarative extension
98 extern const char kRulesStoreName
[];
100 // The URL query parameter key corresponding to multi-login user index.
101 extern const char kAuthUserQueryKey
[];
103 } // namespace extensions
105 namespace extension_misc
{
107 // Matches chrome.windows.WINDOW_ID_NONE.
108 const int kUnknownWindowId
= -1;
110 // Matches chrome.windows.WINDOW_ID_CURRENT.
111 const int kCurrentWindowId
= -2;
113 // Note: this structure is an ASN.1 which encodes the algorithm used
114 // with its parameters. This is defined in PKCS #1 v2.1 (RFC 3447).
115 // It is encoding: { OID sha1WithRSAEncryption PARAMETERS NULL }
116 const uint8 kSignatureAlgorithm
[15] = {0x30, 0x0d, 0x06, 0x09, 0x2a,
117 0x86, 0x48, 0x86, 0xf7, 0x0d,
118 0x01, 0x01, 0x05, 0x05, 0x00};
120 // NOTE: If you change this list, you should also change kExtensionIconSizes
122 enum ExtensionIcons
{
123 EXTENSION_ICON_GIGANTOR
= 512,
124 EXTENSION_ICON_EXTRA_LARGE
= 256,
125 EXTENSION_ICON_LARGE
= 128,
126 EXTENSION_ICON_MEDIUM
= 48,
127 EXTENSION_ICON_SMALL
= 32,
128 EXTENSION_ICON_SMALLISH
= 24,
129 EXTENSION_ICON_ACTION
= 19,
130 EXTENSION_ICON_BITTY
= 16,
131 EXTENSION_ICON_INVALID
= 0,
134 // List of sizes for extension icons that can be defined in the manifest.
135 extern const int kExtensionIconSizes
[];
136 extern const size_t kNumExtensionIconSizes
;
138 // List of sizes for extension icons that can be defined in the manifest.
139 extern const int kExtensionActionIconSizes
[];
140 extern const size_t kNumExtensionActionIconSizes
;
142 } // namespace extension_misc
144 #endif // EXTENSIONS_COMMON_CONSTANTS_H_