1 // Copyright 2017 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/webui_url_constants.h"
6 
7 #include "base/stl_util.h"
8 #include "base/strings/string_piece.h"
9 #include "components/nacl/common/buildflags.h"
10 #include "components/safe_browsing/core/web_ui/constants.h"
11 #include "extensions/buildflags/buildflags.h"
12 
13 namespace chrome {
14 
15 // Please keep this file in the same order as the header.
16 
17 // Note: Add hosts to |kChromeHostURLs| at the bottom of this file to be listed
18 // by chrome://chrome-urls (about:about) and the built-in AutocompleteProvider.
19 
20 const char kChromeUIAboutHost[] = "about";
21 const char kChromeUIAboutURL[] = "chrome://about/";
22 const char kChromeUIAccessibilityHost[] = "accessibility";
23 const char kChromeUIAppIconHost[] = "app-icon";
24 const char kChromeUIAppIconURL[] = "chrome://app-icon/";
25 const char kChromeUIAppLauncherPageHost[] = "apps";
26 const char kChromeUIAppsURL[] = "chrome://apps/";
27 const char kChromeUIAutofillInternalsHost[] = "autofill-internals";
28 const char kChromeUIBluetoothInternalsHost[] = "bluetooth-internals";
29 const char kChromeUIBookmarksHost[] = "bookmarks";
30 const char kChromeUIBookmarksURL[] = "chrome://bookmarks/";
31 const char kChromeUICertificateViewerHost[] = "view-cert";
32 const char kChromeUICertificateViewerURL[] = "chrome://view-cert/";
33 const char kChromeUIChromeSigninHost[] = "chrome-signin";
34 const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/";
35 const char kChromeUIChromeURLsHost[] = "chrome-urls";
36 const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/";
37 const char kChromeUIComponentsHost[] = "components";
38 const char kChromeUIConflictsHost[] = "conflicts";
39 const char kChromeUIConstrainedHTMLTestURL[] = "chrome://constrained-test/";
40 const char kChromeUIContentSettingsURL[] = "chrome://settings/content";
41 // TODO (crbug.com/1107816): Remove deprecated cookie URL redirection.
42 const char kChromeUICookieSettingsDeprecatedURL[] =
43     "chrome://settings/content/cookies";
44 const char kChromeUICookieSettingsURL[] = "chrome://settings/cookies";
45 const char kChromeUICrashHost[] = "crash";
46 const char kChromeUICrashesHost[] = "crashes";
47 const char kChromeUICreditsHost[] = "credits";
48 const char kChromeUICreditsURL[] = "chrome://credits/";
49 const char kChromeUIDefaultHost[] = "version";
50 const char kChromeUIDelayedHangUIHost[] = "delayeduithreadhang";
51 const char kChromeUIDevToolsBlankPath[] = "blank";
52 const char kChromeUIDevToolsBundledPath[] = "bundled";
53 const char kChromeUIDevToolsCustomPath[] = "custom";
54 const char kChromeUIDevToolsHost[] = "devtools";
55 const char kChromeUIDevToolsRemotePath[] = "remote";
56 const char kChromeUIDevToolsURL[] =
57     "devtools://devtools/bundled/inspector.html";
58 const char kChromeUIDeviceLogHost[] = "device-log";
59 const char kChromeUIDevicesHost[] = "devices";
60 const char kChromeUIDevicesURL[] = "chrome://devices/";
61 const char kChromeUIDevUiLoaderURL[] = "chrome://dev-ui-loader/";
62 const char kChromeUIDiceWebSigninInterceptHost[] = "signin-dice-web-intercept";
63 const char kChromeUIDiceWebSigninInterceptURL[] =
64     "chrome://signin-dice-web-intercept/";
65 const char kChromeUIDomainReliabilityInternalsHost[] =
66     "domain-reliability-internals";
67 const char kChromeUIDownloadInternalsHost[] = "download-internals";
68 const char kChromeUIDownloadsHost[] = "downloads";
69 const char kChromeUIDownloadsURL[] = "chrome://downloads/";
70 const char kChromeUIDriveInternalsHost[] = "drive-internals";
71 const char kChromeUIEDUCoexistenceLoginURLV1[] = "chrome://chrome-signin/edu";
72 const char kChromeUIEDUCoexistenceLoginURLV2[] =
73     "chrome://chrome-signin/edu-coexistence";
74 const char kChromeUIExtensionIconHost[] = "extension-icon";
75 const char kChromeUIExtensionIconURL[] = "chrome://extension-icon/";
76 const char kChromeUIExtensionsHost[] = "extensions";
77 const char kChromeUIExtensionsInternalsHost[] = "extensions-internals";
78 const char kChromeUIExtensionsURL[] = "chrome://extensions/";
79 const char kChromeUIFaviconHost[] = "favicon";
80 const char kChromeUIFaviconURL[] = "chrome://favicon/";
81 const char kChromeUIFavicon2Host[] = "favicon2";
82 const char kChromeUIFileiconURL[] = "chrome://fileicon/";
83 const char kChromeUIFlagsHost[] = "flags";
84 const char kChromeUIFlagsURL[] = "chrome://flags/";
85 const char kChromeUIGCMInternalsHost[] = "gcm-internals";
86 const char kChromeUIHangUIHost[] = "uithreadhang";
87 const char kChromeUIHelpHost[] = "help";
88 const char kChromeUIHelpURL[] = "chrome://help/";
89 const char kChromeUIHistoryHost[] = "history";
90 const char kChromeUIHistorySyncedTabs[] = "/syncedTabs";
91 const char kChromeUIHistoryURL[] = "chrome://history/";
92 const char kChromeUIIdentityInternalsHost[] = "identity-internals";
93 const char kChromeUIImageHost[] = "image";
94 const char kChromeUIImageURL[] = "chrome://image/";
95 const char kChromeUIInspectHost[] = "inspect";
96 const char kChromeUIInspectURL[] = "chrome://inspect/";
97 const char kChromeUIInternalsHost[] = "internals";
98 const char kChromeUIInternalsQueryTilesPath[] = "query-tiles";
99 const char kChromeUIInternalsWebAppPath[] = "web-app";
100 const char kChromeUIInterstitialHost[] = "interstitials";
101 const char kChromeUIInterstitialURL[] = "chrome://interstitials/";
102 const char kChromeUIInterventionsInternalsHost[] = "interventions-internals";
103 const char kChromeUIInvalidationsHost[] = "invalidations";
104 const char kChromeUIKillHost[] = "kill";
105 const char kChromeUILocalStateHost[] = "local-state";
106 const char kChromeUIManagementHost[] = "management";
107 const char kChromeUIManagementURL[] = "chrome://management";
108 const char kChromeUIMdUserManagerHost[] = "md-user-manager";
109 const char kChromeUIMdUserManagerUrl[] = "chrome://md-user-manager/";
110 const char kChromeUIMediaEngagementHost[] = "media-engagement";
111 const char kChromeUIMediaFeedsHost[] = "media-feeds";
112 const char kChromeUIMediaHistoryHost[] = "media-history";
113 const char kChromeUIMediaRouterInternalsHost[] = "media-router-internals";
114 const char kChromeUIMemoryInternalsHost[] = "memory-internals";
115 const char kChromeUINTPTilesInternalsHost[] = "ntp-tiles-internals";
116 const char kChromeUINaClHost[] = "nacl";
117 const char kChromeUINetExportHost[] = "net-export";
118 const char kChromeUINetInternalsHost[] = "net-internals";
119 const char kChromeUINetInternalsURL[] = "chrome://net-internals/";
120 const char kChromeUINewTabHost[] = "newtab";
121 const char kChromeUINewTabIconHost[] = "ntpicon";
122 const char kChromeUINewTabPageHost[] = "new-tab-page";
123 const char kChromeUINewTabPageURL[] = "chrome://new-tab-page";
124 const char kChromeUINewTabURL[] = "chrome://newtab/";
125 const char kChromeUIOmniboxHost[] = "omnibox";
126 const char kChromeUIOmniboxURL[] = "chrome://omnibox/";
127 const char kChromeUIPasswordManagerInternalsHost[] =
128     "password-manager-internals";
129 const char kChromeUIPolicyHost[] = "policy";
130 const char kChromeUIPolicyURL[] = "chrome://policy/";
131 const char kChromeUIPredictorsHost[] = "predictors";
132 const char kChromeUIPrefsInternalsHost[] = "prefs-internals";
133 const char kChromeUIPrintURL[] = "chrome://print/";
134 const char kChromeUIQuitHost[] = "quit";
135 const char kChromeUIQuitURL[] = "chrome://quit/";
136 const char kChromeUIQuotaInternalsHost[] = "quota-internals";
137 const char kChromeUIResetPasswordHost[] = "reset-password";
138 const char kChromeUIResetPasswordURL[] = "chrome://reset-password/";
139 const char kChromeUIRestartHost[] = "restart";
140 const char kChromeUIRestartURL[] = "chrome://restart/";
141 const char kChromeUISafetyPixelbookURL[] = "https://g.co/Pixelbook/legal";
142 const char kChromeUISafetyPixelSlateURL[] = "https://g.co/PixelSlate/legal";
143 const char kChromeUISettingsHost[] = "settings";
144 const char kChromeUISettingsURL[] = "chrome://settings/";
145 const char kChromeUISignInInternalsHost[] = "signin-internals";
146 const char kChromeUISigninEmailConfirmationHost[] = "signin-email-confirmation";
147 const char kChromeUISigninEmailConfirmationURL[] =
148     "chrome://signin-email-confirmation";
149 const char kChromeUISigninErrorHost[] = "signin-error";
150 const char kChromeUISigninErrorURL[] = "chrome://signin-error/";
151 const char kChromeUISigninReauthHost[] = "signin-reauth";
152 const char kChromeUISigninReauthURL[] = "chrome://signin-reauth/";
153 const char kChromeUISiteDetailsPrefixURL[] =
154     "chrome://settings/content/siteDetails?site=";
155 const char kChromeUISiteEngagementHost[] = "site-engagement";
156 const char kChromeUISuggestionsHost[] = "suggestions";
157 const char kChromeUISuggestionsURL[] = "chrome://suggestions/";
158 const char kChromeUISupervisedUserInternalsHost[] = "supervised-user-internals";
159 const char kChromeUISupervisedUserPassphrasePageHost[] =
160     "managed-user-passphrase";
161 const char kChromeUISyncConfirmationHost[] = "sync-confirmation";
162 const char kChromeUISyncConfirmationURL[] = "chrome://sync-confirmation/";
163 const char kChromeUISyncFileSystemInternalsHost[] = "syncfs-internals";
164 const char kChromeUISyncHost[] = "sync";
165 const char kChromeUISyncInternalsHost[] = "sync-internals";
166 const char kChromeUISystemInfoHost[] = "system";
167 const char kChromeUITermsHost[] = "terms";
168 const char kChromeUITermsURL[] = "chrome://terms/";
169 const char kChromeUIThemeHost[] = "theme";
170 const char kChromeUIThemeURL[] = "chrome://theme/";
171 const char kChromeUIUntrustedThemeURL[] = "chrome-untrusted://theme/";
172 const char kChromeUIThumbnailHost2[] = "thumb2";
173 const char kChromeUIThumbnailHost[] = "thumb";
174 const char kChromeUIThumbnailListHost[] = "thumbnails";
175 const char kChromeUIThumbnailURL[] = "chrome://thumb/";
176 const char kChromeUITranslateInternalsHost[] = "translate-internals";
177 const char kChromeUIUsbInternalsHost[] = "usb-internals";
178 const char kChromeUIUserActionsHost[] = "user-actions";
179 const char kChromeUIVersionHost[] = "version";
180 const char kChromeUIVersionURL[] = "chrome://version/";
181 const char kChromeUIWebFooterExperimentHost[] = "web-footer-experiment";
182 const char kChromeUIWebFooterExperimentURL[] =
183     "chrome://web-footer-experiment/";
184 const char kChromeUIWelcomeHost[] = "welcome";
185 const char kChromeUIWelcomeURL[] = "chrome://welcome/";
186 
187 #if defined(OS_WIN)
188 // TODO(crbug.com/1003960): Remove when issue is resolved.
189 const char kChromeUIWelcomeWin10Host[] = "welcome-win10";
190 #endif  // defined(OS_WIN)
191 
192 #if defined(OS_ANDROID)
193 const char kChromeUIExploreSitesInternalsHost[] = "explore-sites-internals";
194 const char kChromeUIJavaCrashURL[] = "chrome://java-crash/";
195 const char kChromeUINativeBookmarksURL[] = "chrome-native://bookmarks/";
196 const char kChromeUINativeExploreURL[] = "chrome-native://explore";
197 const char kChromeUINativeHistoryURL[] = "chrome-native://history/";
198 const char kChromeUINativeNewTabURL[] = "chrome-native://newtab/";
199 const char kChromeUIOfflineInternalsHost[] = "offline-internals";
200 const char kChromeUISnippetsInternalsHost[] = "snippets-internals";
201 const char kChromeUIUntrustedVideoPlayerUrl[] =
202     "chrome-untrusted://video-tutorials/";
203 const char kChromeUIWebApksHost[] = "webapks";
204 #else
205 const char kChromeUINearbyInternalsHost[] = "nearby-internals";
206 const char kChromeUIReadLaterHost[] = "read-later";
207 const char kChromeUIReadLaterURL[] = "chrome://read-later/";
208 #endif
209 
210 #if defined(OS_CHROMEOS)
211 // Keep alphabetized.
212 const char kChromeUIAccountManagerErrorHost[] = "account-manager-error";
213 const char kChromeUIAccountManagerErrorURL[] = "chrome://account-manager-error";
214 const char kChromeUIAccountManagerWelcomeHost[] = "account-manager-welcome";
215 const char kChromeUIAccountManagerWelcomeURL[] =
216     "chrome://account-manager-welcome";
217 const char kChromeUIAccountMigrationWelcomeHost[] = "account-migration-welcome";
218 const char kChromeUIAccountMigrationWelcomeURL[] =
219     "chrome://account-migration-welcome";
220 const char kChromeUIActivationMessageHost[] = "activationmessage";
221 const char kChromeUIAddSupervisionHost[] = "add-supervision";
222 const char kChromeUIAddSupervisionURL[] = "chrome://add-supervision/";
223 const char kChromeUIArcGraphicsTracingHost[] = "arc-graphics-tracing";
224 const char kChromeUIArcGraphicsTracingURL[] = "chrome://arc-graphics-tracing/";
225 const char kChromeUIArcOverviewTracingHost[] = "arc-overview-tracing";
226 const char kChromeUIArcOverviewTracingURL[] = "chrome://arc-overview-tracing/";
227 const char kChromeUIArcPowerControlHost[] = "arc-power-control";
228 const char kChromeUIArcPowerControlURL[] = "chrome://arc-power-control/";
229 const char kChromeUIAssistantOptInHost[] = "assistant-optin";
230 const char kChromeUIAssistantOptInURL[] = "chrome://assistant-optin/";
231 const char kChromeUIAppDisabledHost[] = "app-disabled";
232 const char kChromeUIAppDisabledURL[] = "chrome://app-disabled";
233 const char kChromeUIBluetoothPairingHost[] = "bluetooth-pairing";
234 const char kChromeUIBluetoothPairingURL[] = "chrome://bluetooth-pairing/";
235 const char kChromeUICellularSetupHost[] = "cellular-setup";
236 const char kChromeUICellularSetupUrl[] = "chrome://cellular-setup";
237 const char kChromeUICertificateManagerDialogURL[] =
238     "chrome://certificate-manager/";
239 const char kChromeUICertificateManagerHost[] = "certificate-manager";
240 const char kChromeUIConfirmPasswordChangeHost[] = "confirm-password-change";
241 const char kChromeUIConfirmPasswordChangeUrl[] =
242     "chrome://confirm-password-change";
243 const char kChromeUICrostiniInstallerHost[] = "crostini-installer";
244 const char kChromeUICrostiniInstallerUrl[] = "chrome://crostini-installer";
245 const char kChromeUICrostiniUpgraderHost[] = "crostini-upgrader";
246 const char kChromeUICrostiniUpgraderUrl[] = "chrome://crostini-upgrader";
247 const char kChromeUICryptohomeHost[] = "cryptohome";
248 const char kChromeUIDeviceEmulatorHost[] = "device-emulator";
249 const char kChromeUIFirstRunHost[] = "first-run";
250 const char kChromeUIFirstRunURL[] = "chrome://first-run/";
251 const char kChromeUIIntenetConfigDialogURL[] =
252     "chrome://internet-config-dialog/";
253 const char kChromeUIIntenetDetailDialogURL[] =
254     "chrome://internet-detail-dialog/";
255 const char kChromeUIInternetConfigDialogHost[] = "internet-config-dialog";
256 const char kChromeUIInternetDetailDialogHost[] = "internet-detail-dialog";
257 const char kChromeUICrostiniCreditsHost[] = "crostini-credits";
258 const char kChromeUICrostiniCreditsURL[] = "chrome://crostini-credits/";
259 const char kChromeUILockScreenStartReauthHost[] = "lock-reauth";
260 const char kChromeUILockScreenStartReauthURL[] = "chrome://lock-reauth";
261 const char kChromeUIMachineLearningInternalsHost[] =
262     "machine-learning-internals";
263 const char kChromeUIMobileSetupHost[] = "mobilesetup";
264 const char kChromeUIMobileSetupURL[] = "chrome://mobilesetup/";
265 const char kChromeUIMultiDeviceInternalsHost[] = "multidevice-internals";
266 const char kChromeUIMultiDeviceSetupHost[] = "multidevice-setup";
267 const char kChromeUIMultiDeviceSetupUrl[] = "chrome://multidevice-setup";
268 const char kChromeUINetworkHost[] = "network";
269 const char kChromeUIOSCreditsHost[] = "os-credits";
270 const char kChromeUIOSCreditsURL[] = "chrome://os-credits/";
271 const char kChromeUIOSSettingsHost[] = "os-settings";
272 const char kChromeUIOSSettingsURL[] = "chrome://os-settings/";
273 const char kChromeUIOobeHost[] = "oobe";
274 const char kChromeUIOobeURL[] = "chrome://oobe/";
275 const char kChromeUIPasswordChangeHost[] = "password-change";
276 const char kChromeUIPasswordChangeUrl[] = "chrome://password-change";
277 const char kChromeUIPrintManagementUrl[] = "chrome://print-management";
278 const char kChromeUIPowerHost[] = "power";
279 const char kChromeUIScreenlockIconHost[] = "screenlock-icon";
280 const char kChromeUIScreenlockIconURL[] = "chrome://screenlock-icon/";
281 const char kChromeUISetTimeHost[] = "set-time";
282 const char kChromeUISetTimeURL[] = "chrome://set-time/";
283 const char kChromeUISlowHost[] = "slow";
284 const char kChromeUISlowTraceHost[] = "slow_trace";
285 const char kChromeUISlowURL[] = "chrome://slow/";
286 const char kChromeUISmbShareHost[] = "smb-share-dialog";
287 const char kChromeUISmbShareURL[] = "chrome://smb-share-dialog/";
288 const char kChromeUISmbCredentialsHost[] = "smb-credentials-dialog";
289 const char kChromeUISmbCredentialsURL[] = "chrome://smb-credentials-dialog/";
290 const char kChromeUISysInternalsHost[] = "sys-internals";
291 const char kChromeUIUntrustedCroshURL[] = "chrome-untrusted://crosh/";
292 const char kChromeUIUntrustedTerminalURL[] = "chrome-untrusted://terminal/";
293 const char kChromeUIUserImageHost[] = "userimage";
294 const char kChromeUIUserImageURL[] = "chrome://userimage/";
295 const char kChromeUIUrgentPasswordExpiryNotificationHost[] =
296     "urgent-password-expiry-notification";
297 const char kChromeUIUrgentPasswordExpiryNotificationUrl[] =
298     "chrome://urgent-password-expiry-notification/";
299 // Keep alphabetized.
300 
IsSystemWebUIHost(base::StringPiece host)301 bool IsSystemWebUIHost(base::StringPiece host) {
302   // Compares host instead of full URL for performance (the strings are
303   // shorter).
304   static const char* const kHosts[] = {
305       kChromeUIAccountManagerErrorHost,
306       kChromeUIAccountManagerWelcomeHost,
307       kChromeUIAccountMigrationWelcomeHost,
308       kChromeUIActivationMessageHost,
309       kChromeUIAddSupervisionHost,
310       kChromeUIAssistantOptInHost,
311       kChromeUIBluetoothPairingHost,
312       kChromeUICellularSetupHost,
313       kChromeUICertificateManagerHost,
314       kChromeUICrostiniCreditsHost,
315       kChromeUICrostiniInstallerHost,
316       kChromeUICryptohomeHost,
317       kChromeUIDeviceEmulatorHost,
318       kChromeUIFirstRunHost,
319       kChromeUIInternetConfigDialogHost,
320       kChromeUIInternetDetailDialogHost,
321       kChromeUILockScreenStartReauthHost,
322       kChromeUIMobileSetupHost,
323       kChromeUIMultiDeviceSetupHost,
324       kChromeUINetworkHost,
325       kChromeUIOobeHost,
326       kChromeUIOSCreditsHost,
327       kChromeUIOSSettingsHost,
328       kChromeUIPasswordChangeHost,
329       kChromeUIPowerHost,
330       kChromeUISetTimeHost,
331       kChromeUISmbCredentialsHost,
332       kChromeUISmbShareHost,
333   };
334   for (const char* h : kHosts) {
335     if (host == h)
336       return true;
337   }
338   return false;
339 }
340 #endif  // defined(OS_CHROMEOS)
341 
342 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
343 const char kChromeUIWebUIJsExceptionHost[] = "webuijsexception";
344 const char kChromeUIWebUIJsExceptionURL[] = "chrome://webuijsexception/";
345 #endif
346 
347 #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) || \
348     defined(OS_CHROMEOS)
349 const char kChromeUIDiscardsHost[] = "discards";
350 const char kChromeUIDiscardsURL[] = "chrome://discards/";
351 const char kChromeUIHatsHost[] = "hats";
352 const char kChromeUIHatsURL[] = "chrome://hats/";
353 #endif
354 
355 #if !defined(OS_ANDROID)
356 const char kChromeUINearbyShareHost[] = "nearby";
357 const char kChromeUINearbyShareURL[] = "chrome://nearby/";
358 #endif  // !defined(OS_ANDROID)
359 
360 #if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID)
361 const char kChromeUILinuxProxyConfigHost[] = "linux-proxy-config";
362 #endif
363 
364 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
365     defined(OS_ANDROID)
366 const char kChromeUISandboxHost[] = "sandbox";
367 #endif
368 
369 #if defined(OS_WIN) || defined(OS_MAC) || \
370     (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
371 const char kChromeUIBrowserSwitchHost[] = "browser-switch";
372 const char kChromeUIBrowserSwitchURL[] = "chrome://browser-switch/";
373 const char kChromeUIProfileCustomizationHost[] = "profile-customization";
374 const char kChromeUIProfileCustomizationURL[] =
375     "chrome://profile-customization";
376 const char kChromeUIProfilePickerHost[] = "profile-picker";
377 const char kChromeUIProfilePickerUrl[] = "chrome://profile-picker/";
378 const char kChromeUIProfilePickerStartupQuery[] = "startup";
379 #endif
380 
381 #if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(TOOLKIT_VIEWS)) || defined(OS_BSD) || \
382     defined(USE_AURA)
383 const char kChromeUITabModalConfirmDialogHost[] = "tab-modal-confirm-dialog";
384 #endif
385 
386 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
387 const char kChromeUIPrintHost[] = "print";
388 #endif
389 
390 #if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
391 const char kChromeUITabStripHost[] = "tab-strip";
392 const char kChromeUITabStripURL[] = "chrome://tab-strip";
393 #endif
394 
395 #if !defined(OS_ANDROID)
396 const char kChromeUICommanderHost[] = "commander";
397 const char kChromeUICommanderURL[] = "chrome://commander";
398 const char kChromeUITabSearchHost[] = "tab-search";
399 const char kChromeUITabSearchURL[] = "chrome://tab-search/";
400 #endif
401 
402 const char kChromeUIWebRtcLogsHost[] = "webrtc-logs";
403 
404 // Settings sub pages.
405 
406 // NOTE: Add sub page paths to |kChromeSettingsSubPages| in
407 // chrome_autocomplete_provider_client.cc to be listed by the built-in
408 // AutocompleteProvider.
409 
410 const char kAccessibilitySubPage[] = "accessibility";
411 const char kAddressesSubPage[] = "addresses";
412 const char kAppearanceSubPage[] = "appearance";
413 const char kAutofillSubPage[] = "autofill";
414 const char kClearBrowserDataSubPage[] = "clearBrowserData";
415 const char kCloudPrintersSubPage[] = "cloudPrinters";
416 const char kContentSettingsSubPage[] = "content";
417 const char kCookieSettingsSubPage[] = "cookies";
418 const char kDownloadsSubPage[] = "downloads";
419 const char kHandlerSettingsSubPage[] = "handlers";
420 const char kImportDataSubPage[] = "importData";
421 const char kLanguagesSubPage[] = "languages/details";
422 const char kLanguageOptionsSubPage[] = "languages";
423 const char kOnStartupSubPage[] = "onStartup";
424 const char kPasswordCheckSubPage[] = "passwords/check?start=true";
425 const char kPasswordManagerSubPage[] = "passwords";
426 const char kPaymentsSubPage[] = "payments";
427 const char kPrintingSettingsSubPage[] = "printing";
428 const char kPrivacySubPage[] = "privacy";
429 const char kResetSubPage[] = "reset";
430 const char kResetProfileSettingsSubPage[] = "resetProfileSettings";
431 const char kSafeBrowsingEnhancedProtectionSubPage[] = "security?q=enhanced";
432 const char kSafetyCheckSubPage[] = "safetyCheck";
433 const char kSearchSubPage[] = "search";
434 const char kSearchEnginesSubPage[] = "searchEngines";
435 const char kSignOutSubPage[] = "signOut";
436 const char kSyncSetupSubPage[] = "syncSetup";
437 const char kTriggeredResetProfileSettingsSubPage[] =
438     "triggeredResetProfileSettings";
439 const char kCreateProfileSubPage[] = "createProfile";
440 const char kManageProfileSubPage[] = "manageProfile";
441 const char kPeopleSubPage[] = "people";
442 
443 #if defined(OS_WIN)
444 const char kCleanupSubPage[] = "cleanup";
445 #endif  // defined(OS_WIN)
446 
447 // Extension sub pages.
448 const char kExtensionConfigureCommandsSubPage[] = "configureCommands";
449 
450 // Add hosts here to be included in chrome://chrome-urls (about:about).
451 // These hosts will also be suggested by BuiltinProvider.
452 const char* const kChromeHostURLs[] = {
453     kChromeUIAboutHost,
454     kChromeUIAccessibilityHost,
455     kChromeUIAutofillInternalsHost,
456     kChromeUIBluetoothInternalsHost,
457     kChromeUIChromeURLsHost,
458     kChromeUIComponentsHost,
459     kChromeUICrashesHost,
460     kChromeUICreditsHost,
461 #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD)
462     kChromeUIDeviceEmulatorHost,
463 #endif
464     kChromeUIDeviceLogHost,
465     kChromeUIDownloadInternalsHost,
466     kChromeUIFlagsHost,
467     kChromeUIGCMInternalsHost,
468     kChromeUIHistoryHost,
469     kChromeUIInterstitialHost,
470     kChromeUIInterventionsInternalsHost,
471     kChromeUIInvalidationsHost,
472     kChromeUILocalStateHost,
473 #if !defined(OS_ANDROID)
474     kChromeUIManagementHost,
475 #endif
476     kChromeUIMediaEngagementHost,
477     kChromeUINetExportHost,
478     kChromeUINetInternalsHost,
479     kChromeUINewTabHost,
480     kChromeUIOmniboxHost,
481     kChromeUIPasswordManagerInternalsHost,
482     kChromeUIPolicyHost,
483     kChromeUIPredictorsHost,
484     kChromeUIPrefsInternalsHost,
485     kChromeUIQuotaInternalsHost,
486     kChromeUISignInInternalsHost,
487     kChromeUISiteEngagementHost,
488     kChromeUINTPTilesInternalsHost,
489     safe_browsing::kChromeUISafeBrowsingHost,
490     kChromeUISuggestionsHost,
491     kChromeUISupervisedUserInternalsHost,
492     kChromeUISyncInternalsHost,
493 #if !defined(OS_ANDROID)
494     kChromeUITermsHost,
495     kChromeUIThumbnailListHost,
496 #endif
497     kChromeUITranslateInternalsHost,
498     kChromeUIUsbInternalsHost,
499     kChromeUIUserActionsHost,
500     kChromeUIVersionHost,
501     content::kChromeUIAppCacheInternalsHost,
502     content::kChromeUIBlobInternalsHost,
503     content::kChromeUIConversionInternalsHost,
504     content::kChromeUIDinoHost,
505     content::kChromeUIGpuHost,
506     content::kChromeUIHistogramHost,
507     content::kChromeUIIndexedDBInternalsHost,
508     content::kChromeUIMediaInternalsHost,
509     content::kChromeUINetworkErrorHost,
510     content::kChromeUINetworkErrorsListingHost,
511     content::kChromeUIProcessInternalsHost,
512     content::kChromeUIServiceWorkerInternalsHost,
513 #if !defined(OS_ANDROID)
514     content::kChromeUITracingHost,
515 #endif
516     content::kChromeUIUkmHost,
517     content::kChromeUIWebRTCInternalsHost,
518 #if !defined(OS_ANDROID)
519 #if !defined(OS_CHROMEOS)
520     kChromeUIAppLauncherPageHost,
521 #endif
522     kChromeUIBookmarksHost,
523     kChromeUIDownloadsHost,
524     kChromeUIHelpHost,
525     kChromeUIInspectHost,
526     kChromeUINewTabPageHost,
527     kChromeUISettingsHost,
528     kChromeUISystemInfoHost,
529 #endif
530 #if defined(OS_ANDROID)
531     kChromeUIExploreSitesInternalsHost,
532     kChromeUIOfflineInternalsHost,
533     kChromeUISnippetsInternalsHost,
534     kChromeUIWebApksHost,
535 #endif
536 #if defined(OS_CHROMEOS)
537     kChromeUICertificateManagerHost,
538     kChromeUICrostiniCreditsHost,
539     kChromeUICryptohomeHost,
540     kChromeUIDriveInternalsHost,
541     kChromeUIFirstRunHost,
542     kChromeUIMachineLearningInternalsHost,
543     kChromeUINetworkHost,
544     kChromeUIOobeHost,
545     kChromeUIOSCreditsHost,
546     kChromeUIOSSettingsHost,
547     kChromeUIPowerHost,
548     kChromeUIInternetConfigDialogHost,
549     kChromeUIInternetDetailDialogHost,
550     kChromeUIAssistantOptInHost,
551 #endif
552 #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) || \
553     defined(OS_CHROMEOS)
554     kChromeUIDiscardsHost,
555 #endif
556 #if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID)
557     kChromeUILinuxProxyConfigHost,
558 #endif
559 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
560     defined(OS_ANDROID)
561     kChromeUISandboxHost,
562 #endif
563 #if defined(OS_WIN)
564     kChromeUIConflictsHost,
565 #endif
566 #if BUILDFLAG(ENABLE_NACL)
567     kChromeUINaClHost,
568 #endif
569 #if BUILDFLAG(ENABLE_EXTENSIONS)
570     kChromeUIExtensionsHost,
571 #endif
572 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
573     kChromeUIPrintHost,
574 #endif
575 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
576     kChromeUIDevicesHost,
577 #endif
578     kChromeUIWebRtcLogsHost,
579 };
580 const size_t kNumberOfChromeHostURLs = base::size(kChromeHostURLs);
581 
582 // Add chrome://internals/* subpages here to be included in chrome://chrome-urls
583 // (about:about).
584 const char* const kChromeInternalsPathURLs[] = {
585 #if defined(OS_ANDROID)
586     kChromeUIInternalsQueryTilesPath,
587 #else
588     kChromeUIInternalsWebAppPath,
589 #endif  // defined(OS_ANDROID)
590 };
591 const size_t kNumberOfChromeInternalsPathURLs =
592     base::size(kChromeInternalsPathURLs);
593 
594 const char* const kChromeDebugURLs[] = {
595     content::kChromeUIBadCastCrashURL,
596     content::kChromeUIBrowserCrashURL,
597     content::kChromeUICrashURL,
598     content::kChromeUIDumpURL,
599     content::kChromeUIKillURL,
600     content::kChromeUIHangURL,
601     content::kChromeUIShorthangURL,
602     content::kChromeUIGpuCleanURL,
603     content::kChromeUIGpuCrashURL,
604     content::kChromeUIGpuHangURL,
605     content::kChromeUIMemoryExhaustURL,
606     content::kChromeUIMemoryPressureCriticalURL,
607     content::kChromeUIMemoryPressureModerateURL,
608     content::kChromeUIPpapiFlashCrashURL,
609     content::kChromeUIPpapiFlashHangURL,
610 #if defined(OS_WIN)
611     content::kChromeUIBrowserHeapCorruptionURL,
612     content::kChromeUIHeapCorruptionCrashURL,
613 #endif
614 #if defined(OS_ANDROID)
615     content::kChromeUIGpuJavaCrashURL,
616     kChromeUIJavaCrashURL,
617 #endif
618 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
619     kChromeUIWebUIJsExceptionURL,
620 #endif
621     kChromeUIQuitURL,
622     kChromeUIRestartURL};
623 const size_t kNumberOfChromeDebugURLs = base::size(kChromeDebugURLs);
624 
625 }  // namespace chrome
626