Home | History | Annotate | Download | only in common
      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 #ifndef EXTENSIONS_COMMON_CONSTANTS_H_
      6 #define EXTENSIONS_COMMON_CONSTANTS_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/files/file_path.h"
     10 
     11 namespace extensions {
     12 
     13 // Scheme we serve extension content from.
     14 extern const char kExtensionScheme[];
     15 
     16 // Canonical schemes you can use as input to GURL.SchemeIs().
     17 extern const char kExtensionResourceScheme[];
     18 
     19 // The name of the manifest inside an extension.
     20 extern const base::FilePath::CharType kManifestFilename[];
     21 
     22 // The name of locale folder inside an extension.
     23 extern const base::FilePath::CharType kLocaleFolder[];
     24 
     25 // The name of the messages file inside an extension.
     26 extern const base::FilePath::CharType kMessagesFilename[];
     27 
     28 // The base directory for subdirectories with platform-specific code.
     29 extern const base::FilePath::CharType kPlatformSpecificFolder[];
     30 
     31 // A directory reserved for metadata, generated either by the webstore
     32 // or chrome.
     33 extern const base::FilePath::CharType kMetadataFolder[];
     34 
     35 // Name of the verified contents file within the metadata folder.
     36 extern const base::FilePath::CharType kVerifiedContentsFilename[];
     37 
     38 // Name of the computed hashes file within the metadata folder.
     39 extern const base::FilePath::CharType kComputedHashesFilename[];
     40 
     41 // The name of the directory inside the profile where extensions are
     42 // installed to.
     43 extern const char kInstallDirectoryName[];
     44 
     45 // The name of a temporary directory to install an extension into for
     46 // validation before finalizing install.
     47 extern const char kTempExtensionName[];
     48 
     49 // The file to write our decoded images to, relative to the extension_path.
     50 extern const char kDecodedImagesFilename[];
     51 
     52 // The file to write our decoded message catalogs to, relative to the
     53 // extension_path.
     54 extern const char kDecodedMessageCatalogsFilename[];
     55 
     56 // The filename to use for a background page generated from
     57 // background.scripts.
     58 extern const char kGeneratedBackgroundPageFilename[];
     59 
     60 // Path to imported modules.
     61 extern const char kModulesDir[];
     62 
     63 // The file extension (.crx) for extensions.
     64 extern const base::FilePath::CharType kExtensionFileExtension[];
     65 
     66 // The file extension (.pem) for private key files.
     67 extern const base::FilePath::CharType kExtensionKeyFileExtension[];
     68 
     69 // Default frequency for auto updates, if turned on.
     70 extern const int kDefaultUpdateFrequencySeconds;
     71 
     72 // The name of the directory inside the profile where per-app local settings
     73 // are stored.
     74 extern const char kLocalAppSettingsDirectoryName[];
     75 
     76 // The name of the directory inside the profile where per-extension local
     77 // settings are stored.
     78 extern const char kLocalExtensionSettingsDirectoryName[];
     79 
     80 // The name of the directory inside the profile where per-app synced settings
     81 // are stored.
     82 extern const char kSyncAppSettingsDirectoryName[];
     83 
     84 // The name of the directory inside the profile where per-extension synced
     85 // settings are stored.
     86 extern const char kSyncExtensionSettingsDirectoryName[];
     87 
     88 // The name of the directory inside the profile where per-extension persistent
     89 // managed settings are stored.
     90 extern const char kManagedSettingsDirectoryName[];
     91 
     92 // The name of the database inside the profile where chrome-internal
     93 // extension state resides.
     94 extern const char kStateStoreName[];
     95 
     96 // The name of the database inside the profile where declarative extension
     97 // rules are stored.
     98 extern const char kRulesStoreName[];
     99 
    100 // The URL query parameter key corresponding to multi-login user index.
    101 extern const char kAuthUserQueryKey[];
    102 
    103 }  // namespace extensions
    104 
    105 namespace extension_misc {
    106 
    107 // Matches chrome.windows.WINDOW_ID_NONE.
    108 const int kUnknownWindowId = -1;
    109 
    110 // Matches chrome.windows.WINDOW_ID_CURRENT.
    111 const int kCurrentWindowId = -2;
    112 
    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};
    119 
    120 // NOTE: If you change this list, you should also change kExtensionIconSizes
    121 // in cc file.
    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,
    132 };
    133 
    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;
    137 
    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;
    141 
    142 }  // namespace extension_misc
    143 
    144 #endif  // EXTENSIONS_COMMON_CONSTANTS_H_
    145