blob: a2a32bd293de009bfb6ce0fc2d78294cdc443688 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdlib.h>
#include "chrome/common/url_constants.h"
#include "googleurl/src/url_util.h"
namespace chrome {
const char kAboutScheme[] = "about";
const char kChromeInternalScheme[] = "chrome-internal";
const char kChromeUIScheme[] = "chrome";
const char kDataScheme[] = "data";
const char kExtensionScheme[] = "chrome-extension";
const char kFileScheme[] = "file";
const char kFtpScheme[] = "ftp";
const char kGearsScheme[] = "gears";
const char kHttpScheme[] = "http";
const char kHttpsScheme[] = "https";
const char kJavaScriptScheme[] = "javascript";
const char kMailToScheme[] = "mailto";
const char kMetadataScheme[] = "metadata";
const char kUserScriptScheme[] = "chrome-user-script";
const char kViewSourceScheme[] = "view-source";
#if defined(OS_CHROMEOS)
const char kCrosScheme[] = "cros";
#endif
const char kStandardSchemeSeparator[] = "://";
const char* kSavableSchemes[] = {
kHttpScheme,
kHttpsScheme,
kFileScheme,
kFtpScheme,
kExtensionScheme,
kChromeUIScheme,
NULL
};
const char kAboutAppCacheInternalsURL[] = "about:appcache-internals";
const char kAboutBlankURL[] = "about:blank";
const char kAboutCacheURL[] = "about:cache";
const char kAboutCrashURL[] = "about:crash";
const char kAboutCreditsURL[] = "about:credits";
const char kAboutHangURL[] = "about:hang";
const char kAboutMemoryURL[] = "about:memory";
const char kAboutNetInternalsURL[] = "about:net-internals";
const char kAboutPluginsURL[] = "about:plugins";
const char kAboutShorthangURL[] = "about:shorthang";
const char kAboutSystemURL[] = "about:system";
const char kAboutTermsURL[] = "about:terms";
const char kAboutAboutURL[] = "about:about";
const char kAboutDNSURL[] = "about:dns";
const char kAboutHistogramsURL[] = "about:histograms";
const char kAboutVersionURL[] = "about:version";
// Use an obfuscated URL to make this nondiscoverable, we only want this
// to be used for testing.
const char kAboutBrowserCrash[] = "about:inducebrowsercrashforrealz";
const char kChromeUIAppLauncherURL[] = "chrome://newtab/#mode=app-launcher";
const char kChromeUIBookmarksURL[] = "chrome://bookmarks/";
const char kChromeUIDevToolsURL[] = "chrome://devtools/";
const char kChromeUIDownloadsURL[] = "chrome://downloads/";
const char kChromeUIExtensionsURL[] = "chrome://extensions/";
const char kChromeUIFavIconURL[] = "chrome://favicon/";
const char kChromeUIFileBrowseURL[] = "chrome://filebrowse/";
const char kChromeUIHistoryURL[] = "chrome://history/";
const char kChromeUIHistory2URL[] = "chrome://history2/";
const char kChromeUIIPCURL[] = "chrome://about/ipc";
const char kChromeUIMediaplayerURL[] = "chrome://mediaplayer/";
const char kChromeUINewTabURL[] = "chrome://newtab";
const char kChromeUIOptionsURL[] = "chrome://options/";
const char kChromeUIPluginsURL[] = "chrome://plugins/";
const char kChromeUIPrintURL[] = "chrome://print/";
const char kChromeUIRegisterPageURL[] = "chrome://register/";
const char kChromeUISlideshowURL[] = "chrome://slideshow/";
const char kChromeUIBookmarksHost[] = "bookmarks";
const char kChromeUIDevToolsHost[] = "devtools";
const char kChromeUIDialogHost[] = "dialog";
const char kChromeUIDownloadsHost[] = "downloads";
const char kChromeUIExtensionsHost[] = "extensions";
const char kChromeUIFavIconHost[] = "favicon";
const char kChromeUIFileBrowseHost[] = "filebrowse";
const char kChromeUIHistoryHost[] = "history";
const char kChromeUIHistory2Host[] = "history2";
const char kChromeUIInspectorHost[] = "inspector";
const char kChromeUIMediaplayerHost[] = "mediaplayer";
const char kChromeUINetInternalsHost[] = "net-internals";
const char kChromeUINewTabHost[] = "newtab";
const char kChromeUIOptionsHost[] = "options";
const char kChromeUIPluginsHost[] = "plugins";
const char kChromeUIPrintHost[] = "print";
const char kChromeUIRegisterPageHost[] = "register";
const char kChromeUIRemotingHost[] = "remoting";
const char kChromeUIResourcesHost[] = "resources";
const char kChromeUISlideshowHost[] = "slideshow";
const char kChromeUISyncResourcesHost[] = "syncresources";
const char kChromeUIThemePath[] = "theme";
const char kChromeUIThumbnailPath[] = "thumb";
const char kAppCacheViewInternalsURL[] = "chrome://appcache-internals/";
const char kCloudPrintResourcesURL[] = "chrome://cloudprintresources/";
const char kCloudPrintResourcesHost[] = "cloudprintresources";
const char kNetworkViewInternalsURL[] = "chrome://net-internals/";
const char kNetworkViewCacheURL[] = "chrome://view-http-cache/";
void RegisterChromeSchemes() {
// Don't need "chrome-internal" which was used in old versions of Chrome for
// the new tab page.
url_util::AddStandardScheme(kChromeUIScheme);
url_util::AddStandardScheme(kGearsScheme);
url_util::AddStandardScheme(kExtensionScheme);
url_util::AddStandardScheme(kMetadataScheme);
#if defined(OS_CHROMEOS)
url_util::AddStandardScheme(kCrosScheme);
#endif
// Prevent future modification of the standard schemes list. This is to
// prevent accidental creation of data races in the program. AddStandardScheme
// isn't threadsafe so must be called when GURL isn't used on any other
// thread. This is really easy to mess up, so we say that all calls to
// AddStandardScheme in Chrome must be inside this function.
url_util::LockStandardSchemes();
}
} // namespace chrome
|