Home | History | Annotate | Download | only in extensions
      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 CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
      6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
      7 
      8 #include <string>
      9 
     10 #include "base/basictypes.h"
     11 #include "url/gurl.h"
     12 
     13 namespace extension_urls {
     14 
     15 // This returns the compile-time constant webstore update url specific to
     16 // Chrome. Usually you should prefer using GetWebstoreUpdateUrl.
     17 GURL GetDefaultWebstoreUpdateUrl();
     18 
     19 // Field to use with webstore URL for tracking launch source.
     20 extern const char kWebstoreSourceField[];
     21 
     22 // Values to use with webstore URL launch source field.
     23 extern const char kLaunchSourceAppList[];
     24 extern const char kLaunchSourceAppListSearch[];
     25 extern const char kLaunchSourceAppListInfoDialog[];
     26 
     27 }  // namespace extension_urls
     28 
     29 namespace extension_misc {
     30 
     31 // The extension id of the bookmark manager.
     32 extern const char kBookmarkManagerId[];
     33 
     34 // The extension id of the Chrome component application.
     35 extern const char kChromeAppId[];
     36 
     37 // The extension id of the Cloud Print component application.
     38 extern const char kCloudPrintAppId[];
     39 
     40 // The extension id of the Easy Unlock component application.
     41 extern const char kEasyUnlockAppId[];
     42 
     43 // The extension id of the Enterprise Web Store component application.
     44 extern const char kEnterpriseWebStoreAppId[];
     45 
     46 // The extension id of GMail application.
     47 extern const char kGmailAppId[];
     48 
     49 // The extension id of the Google Doc application.
     50 extern const char kGoogleDocAppId[];
     51 
     52 // The extension id of the Google Play Music application.
     53 extern const char kGooglePlayMusicAppId[];
     54 
     55 // The extension id of the Google Search application.
     56 extern const char kGoogleSearchAppId[];
     57 
     58 // The extension id of the Google Sheets application.
     59 extern const char kGoogleSheetsAppId[];
     60 
     61 // The extension id of the Google Slides application.
     62 extern const char kGoogleSlidesAppId[];
     63 
     64 // The extension id of the HTerm app for ChromeOS.
     65 extern const char kHTermAppId[];
     66 
     67 // The extension id of the HTerm dev app for ChromeOS.
     68 extern const char kHTermDevAppId[];
     69 
     70 // The extension id of the Identity API UI application.
     71 extern const char kIdentityApiUiAppId[];
     72 
     73 // The extension id of the Crosh component app for ChromeOS.
     74 extern const char kCroshBuiltinAppId[];
     75 
     76 // The extension id of the hotword audio verification dialogue app.
     77 extern const char kHotwordAudioVerificationAppId[];
     78 
     79 // The extension id of the hotword voice search trigger extension.
     80 extern const char kHotwordExtensionId[];
     81 
     82 // The extension id of the hotword shared module.
     83 extern const char kHotwordSharedModuleId[];
     84 
     85 // The extension id of the PDF extension.
     86 extern const char kPdfExtensionId[];
     87 
     88 // The extension id of the Office Viewer component extension.
     89 extern const char kQuickOfficeComponentExtensionId[];
     90 
     91 // The extension id of the Office Viewer extension on the internal webstore.
     92 extern const char kQuickOfficeInternalExtensionId[];
     93 
     94 // The extension id of the Office Viewer extension.
     95 extern const char kQuickOfficeExtensionId[];
     96 
     97 // The extension id of the settings application.
     98 extern const char kSettingsAppId[];
     99 
    100 // The extension id used for testing streamsPrivate
    101 extern const char kStreamsPrivateTestExtensionId[];
    102 
    103 // The extension id of the Youtube application.
    104 extern const char kYoutubeAppId[];
    105 
    106 // The extension id of the in-app payments support application.
    107 extern const char kInAppPaymentsSupportAppId[];
    108 
    109 // The name of the app launch histogram.
    110 extern const char kAppLaunchHistogram[];
    111 
    112 // The name of the app launch histogram for platform apps.
    113 extern const char kPlatformAppLaunchHistogram[];
    114 
    115 // The buckets used for app launches.
    116 enum AppLaunchBucket {
    117   // Launch from NTP apps section while maximized.
    118   APP_LAUNCH_NTP_APPS_MAXIMIZED,
    119 
    120   // Launch from NTP apps section while collapsed.
    121   APP_LAUNCH_NTP_APPS_COLLAPSED,
    122 
    123   // Launch from NTP apps section while in menu mode.
    124   APP_LAUNCH_NTP_APPS_MENU,
    125 
    126   // Launch from NTP most visited section in any mode.
    127   APP_LAUNCH_NTP_MOST_VISITED,
    128 
    129   // Launch from NTP recently closed section in any mode.
    130   APP_LAUNCH_NTP_RECENTLY_CLOSED,
    131 
    132   // App link clicked from bookmark bar.
    133   APP_LAUNCH_BOOKMARK_BAR,
    134 
    135   // Nvigated to an app from within a web page (like by clicking a link).
    136   APP_LAUNCH_CONTENT_NAVIGATION,
    137 
    138   // Launch from session restore.
    139   APP_LAUNCH_SESSION_RESTORE,
    140 
    141   // Autolaunched at startup, like for pinned tabs.
    142   APP_LAUNCH_AUTOLAUNCH,
    143 
    144   // Launched from omnibox app links.
    145   APP_LAUNCH_OMNIBOX_APP,
    146 
    147   // App URL typed directly into the omnibox (w/ instant turned off).
    148   APP_LAUNCH_OMNIBOX_LOCATION,
    149 
    150   // Navigate to an app URL via instant.
    151   APP_LAUNCH_OMNIBOX_INSTANT,
    152 
    153   // Launch via chrome.management.launchApp.
    154   APP_LAUNCH_EXTENSION_API,
    155 
    156   // Launch an app via a shortcut. This includes using the --app or --app-id
    157   // command line arguments, or via an app shim process on Mac.
    158   APP_LAUNCH_CMD_LINE_APP,
    159 
    160   // App launch by passing the URL on the cmd line (not using app switches).
    161   APP_LAUNCH_CMD_LINE_URL,
    162 
    163   // User clicked web store launcher on NTP.
    164   APP_LAUNCH_NTP_WEBSTORE,
    165 
    166   // App launched after the user re-enabled it on the NTP.
    167   APP_LAUNCH_NTP_APP_RE_ENABLE,
    168 
    169   // URL launched using the --app cmd line option, but the URL does not
    170   // correspond to an installed app. These launches are left over from a
    171   // feature that let you make desktop shortcuts from the file menu.
    172   APP_LAUNCH_CMD_LINE_APP_LEGACY,
    173 
    174   // User clicked web store link on the NTP footer.
    175   APP_LAUNCH_NTP_WEBSTORE_FOOTER,
    176 
    177   // User clicked [+] icon in apps page.
    178   APP_LAUNCH_NTP_WEBSTORE_PLUS_ICON,
    179 
    180   // User clicked icon in app launcher main view.
    181   APP_LAUNCH_APP_LIST_MAIN,
    182 
    183   // User clicked app launcher search result.
    184   APP_LAUNCH_APP_LIST_SEARCH,
    185 
    186   // User clicked the chrome app icon from the app launcher's main view.
    187   APP_LAUNCH_APP_LIST_MAIN_CHROME,
    188 
    189   // User clicked the webstore icon from the app launcher's main view.
    190   APP_LAUNCH_APP_LIST_MAIN_WEBSTORE,
    191 
    192   // User clicked the chrome app icon from the app launcher's search view.
    193   APP_LAUNCH_APP_LIST_SEARCH_CHROME,
    194 
    195   // User clicked the webstore icon from the app launcher's search view.
    196   APP_LAUNCH_APP_LIST_SEARCH_WEBSTORE,
    197   APP_LAUNCH_BUCKET_BOUNDARY,
    198   APP_LAUNCH_BUCKET_INVALID
    199 };
    200 
    201 // The extension id of the ChromeVox extension.
    202 extern const char kChromeVoxExtensionId[];
    203 
    204 #if defined(OS_CHROMEOS)
    205 // Path to preinstalled ChromeVox screen reader extension (relative to
    206 // |chrome::DIR_RESOURCES|).
    207 extern const char kChromeVoxExtensionPath[];
    208 // Name of ChromeVox manifest file.
    209 extern const char kChromeVoxManifestFilename[];
    210 // Name of ChromeVox guest manifest file.
    211 extern const char kChromeVoxGuestManifestFilename[];
    212 // Name of ChromeVox next manifest file.
    213 extern const char kChromeVoxNextManifestFilename[];
    214 // Name of ChromeVox next guest manifest file.
    215 extern const char kChromeVoxNextGuestManifestFilename[];
    216 // Extension id, path (relative to |chrome::DIR_RESOURCES|) and IME engine
    217 // id for the builtin-in Braille IME extension.
    218 extern const char kBrailleImeExtensionId[];
    219 extern const char kBrailleImeExtensionPath[];
    220 extern const char kBrailleImeEngineId[];
    221 // Path to preinstalled Connectivity Diagnostics extension.
    222 extern const char kConnectivityDiagnosticsPath[];
    223 extern const char kConnectivityDiagnosticsKioskPath[];
    224 extern const char kConnectivityDiagnosticsLauncherPath[];
    225 // Path to preinstalled speech synthesis extension.
    226 extern const char kSpeechSynthesisExtensionPath[];
    227 // The extension id of the speech synthesis extension.
    228 extern const char kSpeechSynthesisExtensionId[];
    229 // The extension id of the wallpaper manager application.
    230 extern const char kWallpaperManagerId[];
    231 // The extension id of the first run dialog application.
    232 extern const char kFirstRunDialogId[];
    233 #endif
    234 
    235 // What causes an extension to be installed? Used in histograms, so don't
    236 // change existing values.
    237 enum CrxInstallCause {
    238   INSTALL_CAUSE_UNSET = 0,
    239   INSTALL_CAUSE_USER_DOWNLOAD,
    240   INSTALL_CAUSE_UPDATE,
    241   INSTALL_CAUSE_EXTERNAL_FILE,
    242   INSTALL_CAUSE_AUTOMATION,
    243   NUM_INSTALL_CAUSES
    244 };
    245 
    246 // The states that an app can be in, as reported by chrome.app.installState
    247 // and chrome.app.runningState.
    248 extern const char kAppStateNotInstalled[];
    249 extern const char kAppStateInstalled[];
    250 extern const char kAppStateDisabled[];
    251 extern const char kAppStateRunning[];
    252 extern const char kAppStateCannotRun[];
    253 extern const char kAppStateReadyToRun[];
    254 
    255 // The path part of the file system url used for media file systems.
    256 extern const char kMediaFileSystemPathPart[];
    257 
    258 // The key used for signing some pieces of data from the webstore.
    259 extern const uint8 kWebstoreSignaturesPublicKey[];
    260 extern const int kWebstoreSignaturesPublicKeySize;
    261 
    262 }  // namespace extension_misc
    263 
    264 namespace extensions {
    265 
    266 // This enum is used for the launch type the user wants to use for an
    267 // application.
    268 // Do not remove items or re-order this enum as it is used in preferences
    269 // and histograms.
    270 enum LaunchType {
    271   LAUNCH_TYPE_INVALID = -1,
    272   LAUNCH_TYPE_FIRST = 0,
    273   LAUNCH_TYPE_PINNED = LAUNCH_TYPE_FIRST,
    274   LAUNCH_TYPE_REGULAR = 1,
    275   LAUNCH_TYPE_FULLSCREEN = 2,
    276   LAUNCH_TYPE_WINDOW = 3,
    277   NUM_LAUNCH_TYPES,
    278 
    279   // Launch an app in the in the way a click on the NTP would,
    280   // if no user pref were set.  Update this constant to change
    281   // the default for the NTP and chrome.management.launchApp().
    282   LAUNCH_TYPE_DEFAULT = LAUNCH_TYPE_REGULAR
    283 };
    284 
    285 // Don't remove items or change the order of this enum.  It's used in
    286 // histograms and preferences.
    287 enum LaunchContainer {
    288   LAUNCH_CONTAINER_WINDOW,
    289   LAUNCH_CONTAINER_PANEL,
    290   LAUNCH_CONTAINER_TAB,
    291   // For platform apps, which don't actually have a container (they just get a
    292   // "onLaunched" event).
    293   LAUNCH_CONTAINER_NONE
    294 };
    295 
    296 }  // namespace extensions
    297 
    298 #endif  // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
    299