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 CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
10 #include "base/basictypes.h"
13 namespace extension_urls
{
15 // Returns the URL prefix for the extension/apps gallery. Can be set via the
16 // --apps-gallery-url switch. The URL returned will not contain a trailing
17 // slash. Do not use this as a prefix/extent for the store.
18 std::string
GetWebstoreLaunchURL();
20 // Returns the URL to the extensions category on the Web Store. This is
21 // derived from GetWebstoreLaunchURL().
22 std::string
GetExtensionGalleryURL();
24 // Returns the URL prefix for an item in the extension/app gallery. This URL
25 // will contain a trailing slash and should be concatenated with an item ID
26 // to get the item detail URL.
27 std::string
GetWebstoreItemDetailURLPrefix();
29 // Returns the URL used to get webstore data (ratings, manifest, icon URL,
30 // etc.) about an extension from the webstore as JSON.
31 GURL
GetWebstoreItemJsonDataURL(const std::string
& extension_id
);
33 // Returns the URL used to get webstore search results in JSON format. The URL
34 // returns a JSON dictionary that has the search results (under "results").
35 // Each entry in the array is a dictionary as the data returned for
36 // GetWebstoreItemJsonDataURL above. |query| is the user typed query string.
37 // |hl| is the host language code, e.g. en_US. Both arguments will be escaped
38 // and added as a query parameter to the returned web store json search URL.
39 GURL
GetWebstoreJsonSearchUrl(const std::string
& query
, const std::string
& hl
);
41 // Returns the URL of the web store search results page for |query|.
42 GURL
GetWebstoreSearchPageUrl(const std::string
& query
);
44 // Return the update URL used by gallery/webstore extensions/apps.
45 GURL
GetWebstoreUpdateUrl();
47 // Returns whether the URL is the webstore update URL (just considering host
48 // and path, not scheme, query, etc.)
49 bool IsWebstoreUpdateUrl(const GURL
& update_url
);
51 // Returns true if the URL points to an extension blacklist.
52 bool IsBlacklistUpdateUrl(const GURL
& url
);
53 // The greatest common prefixes of the main extensions gallery's browse and
55 extern const char kGalleryBrowsePrefix
[];
57 // Field to use with webstore URL for tracking launch source.
58 extern const char kWebstoreSourceField
[];
60 // Values to use with webstore URL launch source field.
61 extern const char kLaunchSourceAppList
[];
62 extern const char kLaunchSourceAppListSearch
[];
63 extern const char kLaunchSourceAppListInfoDialog
[];
65 } // namespace extension_urls
67 namespace extension_misc
{
69 // The extension id of the bookmark manager.
70 extern const char kBookmarkManagerId
[];
72 // The extension id of the Chrome component application.
73 extern const char kChromeAppId
[];
75 // The extension id of the Cloud Print component application.
76 extern const char kCloudPrintAppId
[];
78 // The extension id of the Easy Unlock component application.
79 extern const char kEasyUnlockAppId
[];
81 // The extension id of the Enterprise Web Store component application.
82 extern const char kEnterpriseWebStoreAppId
[];
84 // The extension id of GMail application.
85 extern const char kGmailAppId
[];
87 // The extension id of the Google Doc application.
88 extern const char kGoogleDocAppId
[];
90 // The extension id of the Google Play Music application.
91 extern const char kGooglePlayMusicAppId
[];
93 // The extension id of the Google Search application.
94 extern const char kGoogleSearchAppId
[];
96 // The extension id of the Google Sheets application.
97 extern const char kGoogleSheetsAppId
[];
99 // The extension id of the Google Slides application.
100 extern const char kGoogleSlidesAppId
[];
102 // The extension id of the HTerm app for ChromeOS.
103 extern const char kHTermAppId
[];
105 // The extension id of the HTerm dev app for ChromeOS.
106 extern const char kHTermDevAppId
[];
108 // The extension id of the Identity API UI application.
109 extern const char kIdentityApiUiAppId
[];
111 // The extension id of the Crosh component app for ChromeOS.
112 extern const char kCroshBuiltinAppId
[];
114 // The extension id of the hotword voice search trigger extension.
115 extern const char kHotwordExtensionId
[];
117 // The extension id of the PDF extension.
118 extern const char kPdfExtensionId
[];
120 // The extension id of the Office Viewer component extension.
121 extern const char kQuickOfficeComponentExtensionId
[];
123 // The extension id of the Office Viewer extension on the internal webstore.
124 extern const char kQuickOfficeInternalExtensionId
[];
126 // The extension id of the Office Viewer extension.
127 extern const char kQuickOfficeExtensionId
[];
129 // The extension id of the settings application.
130 extern const char kSettingsAppId
[];
132 // The extension id used for testing streamsPrivate
133 extern const char kStreamsPrivateTestExtensionId
[];
135 // The extension id of the Web Store component application.
136 extern const char kWebStoreAppId
[];
138 // The extension id of the Youtube application.
139 extern const char kYoutubeAppId
[];
141 // The extension id of the in-app payments support application.
142 extern const char kInAppPaymentsSupportAppId
[];
144 // The name of the app launch histogram.
145 extern const char kAppLaunchHistogram
[];
147 // The name of the app launch histogram for platform apps.
148 extern const char kPlatformAppLaunchHistogram
[];
150 // The buckets used for app launches.
151 enum AppLaunchBucket
{
152 // Launch from NTP apps section while maximized.
153 APP_LAUNCH_NTP_APPS_MAXIMIZED
,
155 // Launch from NTP apps section while collapsed.
156 APP_LAUNCH_NTP_APPS_COLLAPSED
,
158 // Launch from NTP apps section while in menu mode.
159 APP_LAUNCH_NTP_APPS_MENU
,
161 // Launch from NTP most visited section in any mode.
162 APP_LAUNCH_NTP_MOST_VISITED
,
164 // Launch from NTP recently closed section in any mode.
165 APP_LAUNCH_NTP_RECENTLY_CLOSED
,
167 // App link clicked from bookmark bar.
168 APP_LAUNCH_BOOKMARK_BAR
,
170 // Nvigated to an app from within a web page (like by clicking a link).
171 APP_LAUNCH_CONTENT_NAVIGATION
,
173 // Launch from session restore.
174 APP_LAUNCH_SESSION_RESTORE
,
176 // Autolaunched at startup, like for pinned tabs.
177 APP_LAUNCH_AUTOLAUNCH
,
179 // Launched from omnibox app links.
180 APP_LAUNCH_OMNIBOX_APP
,
182 // App URL typed directly into the omnibox (w/ instant turned off).
183 APP_LAUNCH_OMNIBOX_LOCATION
,
185 // Navigate to an app URL via instant.
186 APP_LAUNCH_OMNIBOX_INSTANT
,
188 // Launch via chrome.management.launchApp.
189 APP_LAUNCH_EXTENSION_API
,
191 // Launch an app via a shortcut. This includes using the --app or --app-id
192 // command line arguments, or via an app shim process on Mac.
193 APP_LAUNCH_CMD_LINE_APP
,
195 // App launch by passing the URL on the cmd line (not using app switches).
196 APP_LAUNCH_CMD_LINE_URL
,
198 // User clicked web store launcher on NTP.
199 APP_LAUNCH_NTP_WEBSTORE
,
201 // App launched after the user re-enabled it on the NTP.
202 APP_LAUNCH_NTP_APP_RE_ENABLE
,
204 // URL launched using the --app cmd line option, but the URL does not
205 // correspond to an installed app. These launches are left over from a
206 // feature that let you make desktop shortcuts from the file menu.
207 APP_LAUNCH_CMD_LINE_APP_LEGACY
,
209 // User clicked web store link on the NTP footer.
210 APP_LAUNCH_NTP_WEBSTORE_FOOTER
,
212 // User clicked [+] icon in apps page.
213 APP_LAUNCH_NTP_WEBSTORE_PLUS_ICON
,
215 // User clicked icon in app launcher main view.
216 APP_LAUNCH_APP_LIST_MAIN
,
218 // User clicked app launcher search result.
219 APP_LAUNCH_APP_LIST_SEARCH
,
221 // User clicked the chrome app icon from the app launcher's main view.
222 APP_LAUNCH_APP_LIST_MAIN_CHROME
,
224 // User clicked the webstore icon from the app launcher's main view.
225 APP_LAUNCH_APP_LIST_MAIN_WEBSTORE
,
227 // User clicked the chrome app icon from the app launcher's search view.
228 APP_LAUNCH_APP_LIST_SEARCH_CHROME
,
230 // User clicked the webstore icon from the app launcher's search view.
231 APP_LAUNCH_APP_LIST_SEARCH_WEBSTORE
,
232 APP_LAUNCH_BUCKET_BOUNDARY
,
233 APP_LAUNCH_BUCKET_INVALID
236 // The extension id of the ChromeVox extension.
237 extern const char kChromeVoxExtensionId
[];
239 #if defined(OS_CHROMEOS)
240 // Path to preinstalled ChromeVox screen reader extension (relative to
241 // |chrome::DIR_RESOURCES|).
242 extern const char kChromeVoxExtensionPath
[];
243 // Path to preinstalled Connectivity Diagnostics extension.
244 extern const char kConnectivityDiagnosticsPath
[];
245 extern const char kConnectivityDiagnosticsLauncherPath
[];
246 // Path to preinstalled speech synthesis extension.
247 extern const char kSpeechSynthesisExtensionPath
[];
248 // The extension id of the speech synthesis extension.
249 extern const char kSpeechSynthesisExtensionId
[];
250 // The extension id of the wallpaper manager application.
251 extern const char kWallpaperManagerId
[];
252 // The extension id of the first run dialog application.
253 extern const char kFirstRunDialogId
[];
256 // What causes an extension to be installed? Used in histograms, so don't
257 // change existing values.
258 enum CrxInstallCause
{
259 INSTALL_CAUSE_UNSET
= 0,
260 INSTALL_CAUSE_USER_DOWNLOAD
,
261 INSTALL_CAUSE_UPDATE
,
262 INSTALL_CAUSE_EXTERNAL_FILE
,
263 INSTALL_CAUSE_AUTOMATION
,
267 // The states that an app can be in, as reported by chrome.app.installState
268 // and chrome.app.runningState.
269 extern const char kAppStateNotInstalled
[];
270 extern const char kAppStateInstalled
[];
271 extern const char kAppStateDisabled
[];
272 extern const char kAppStateRunning
[];
273 extern const char kAppStateCannotRun
[];
274 extern const char kAppStateReadyToRun
[];
276 // The path part of the file system url used for media file systems.
277 extern const char kMediaFileSystemPathPart
[];
279 } // namespace extension_misc
281 namespace extensions
{
283 // This enum is used for the launch type the user wants to use for an
285 // Do not remove items or re-order this enum as it is used in preferences
288 LAUNCH_TYPE_INVALID
= -1,
289 LAUNCH_TYPE_FIRST
= 0,
290 LAUNCH_TYPE_PINNED
= LAUNCH_TYPE_FIRST
,
291 LAUNCH_TYPE_REGULAR
= 1,
292 LAUNCH_TYPE_FULLSCREEN
= 2,
293 LAUNCH_TYPE_WINDOW
= 3,
296 // Launch an app in the in the way a click on the NTP would,
297 // if no user pref were set. Update this constant to change
298 // the default for the NTP and chrome.management.launchApp().
299 LAUNCH_TYPE_DEFAULT
= LAUNCH_TYPE_REGULAR
302 // Don't remove items or change the order of this enum. It's used in
303 // histograms and preferences.
304 enum LaunchContainer
{
305 LAUNCH_CONTAINER_WINDOW
,
306 LAUNCH_CONTAINER_PANEL
,
307 LAUNCH_CONTAINER_TAB
,
308 // For platform apps, which don't actually have a container (they just get a
309 // "onLaunched" event).
310 LAUNCH_CONTAINER_NONE
313 } // namespace extensions
315 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_