OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "chrome/common/url_constants.h" | 7 #include "chrome/common/url_constants.h" |
8 #include "googleurl/src/url_util.h" | 8 #include "googleurl/src/url_util.h" |
9 | 9 |
10 namespace chrome { | 10 namespace chrome { |
11 | 11 |
12 const char kAboutScheme[] = "about"; | 12 const char kAboutScheme[] = "about"; |
13 const char kChromeInternalScheme[] = "chrome-internal"; | 13 const char kChromeInternalScheme[] = "chrome-internal"; |
14 const char kChromeUIScheme[] = "chrome"; | 14 const char kCrosScheme[] = "cros"; |
Nikita (slow)
2010/05/27 17:40:54
Should be unchanged?
glotov
2010/05/27 17:55:05
Done.
| |
15 const char kDataScheme[] = "data"; | 15 const char kDataScheme[] = "data"; |
16 const char kExtensionScheme[] = "chrome-extension"; | 16 const char kExtensionScheme[] = "chrome-extension"; |
17 const char kFileScheme[] = "file"; | 17 const char kFileScheme[] = "file"; |
18 const char kFtpScheme[] = "ftp"; | 18 const char kFtpScheme[] = "ftp"; |
19 const char kGearsScheme[] = "gears"; | 19 const char kGearsScheme[] = "gears"; |
20 const char kHttpScheme[] = "http"; | 20 const char kHttpScheme[] = "http"; |
21 const char kHttpsScheme[] = "https"; | 21 const char kHttpsScheme[] = "https"; |
22 const char kJavaScriptScheme[] = "javascript"; | 22 const char kJavaScriptScheme[] = "javascript"; |
23 const char kMailToScheme[] = "mailto"; | 23 const char kMailToScheme[] = "mailto"; |
24 const char kMetadataScheme[] = "metadata"; | 24 const char kMetadataScheme[] = "metadata"; |
25 const char kPrintScheme[] = "print"; | 25 const char kPrintScheme[] = "print"; |
26 const char kUserScriptScheme[] = "chrome-user-script"; | 26 const char kUserScriptScheme[] = "chrome-user-script"; |
27 const char kViewSourceScheme[] = "view-source"; | 27 const char kViewSourceScheme[] = "view-source"; |
28 | 28 |
29 #if defined(OS_CHROMEOS) | |
30 const char kChromeUIScheme[] = "chrome"; | |
Nikita (slow)
2010/05/27 17:40:54
You should leave kChromeUIScheme unchanged and
int
glotov
2010/05/27 17:55:05
Done. Just didn't uploaded the final patch with th
| |
31 #endif | |
32 | |
29 const char kStandardSchemeSeparator[] = "://"; | 33 const char kStandardSchemeSeparator[] = "://"; |
30 | 34 |
31 const char* kSavableSchemes[] = { | 35 const char* kSavableSchemes[] = { |
32 kHttpScheme, | 36 kHttpScheme, |
33 kHttpsScheme, | 37 kHttpsScheme, |
34 kFileScheme, | 38 kFileScheme, |
35 kFtpScheme, | 39 kFtpScheme, |
36 kExtensionScheme, | 40 kExtensionScheme, |
37 NULL | 41 NULL |
38 }; | 42 }; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 const char kNetworkViewInternalsURL[] = "chrome://net-internals/"; | 103 const char kNetworkViewInternalsURL[] = "chrome://net-internals/"; |
100 const char kNetworkViewCacheURL[] = "chrome://view-http-cache/"; | 104 const char kNetworkViewCacheURL[] = "chrome://view-http-cache/"; |
101 | 105 |
102 void RegisterChromeSchemes() { | 106 void RegisterChromeSchemes() { |
103 // Don't need "chrome-internal" which was used in old versions of Chrome for | 107 // Don't need "chrome-internal" which was used in old versions of Chrome for |
104 // the new tab page. | 108 // the new tab page. |
105 url_util::AddStandardScheme(kChromeUIScheme); | 109 url_util::AddStandardScheme(kChromeUIScheme); |
106 url_util::AddStandardScheme(kGearsScheme); | 110 url_util::AddStandardScheme(kGearsScheme); |
107 url_util::AddStandardScheme(kExtensionScheme); | 111 url_util::AddStandardScheme(kExtensionScheme); |
108 url_util::AddStandardScheme(kMetadataScheme); | 112 url_util::AddStandardScheme(kMetadataScheme); |
113 #if defined(OS_CHROMEOS) | |
114 url_util::AddStandardScheme(kCrosScheme); | |
115 #endif | |
109 | 116 |
110 // Prevent future modification of the standard schemes list. This is to | 117 // Prevent future modification of the standard schemes list. This is to |
111 // prevent accidental creation of data races in the program. AddStandardScheme | 118 // prevent accidental creation of data races in the program. AddStandardScheme |
112 // isn't threadsafe so must be called when GURL isn't used on any other | 119 // isn't threadsafe so must be called when GURL isn't used on any other |
113 // thread. This is really easy to mess up, so we say that all calls to | 120 // thread. This is really easy to mess up, so we say that all calls to |
114 // AddStandardScheme in Chrome must be inside this function. | 121 // AddStandardScheme in Chrome must be inside this function. |
115 url_util::LockStandardSchemes(); | 122 url_util::LockStandardSchemes(); |
116 } | 123 } |
117 | 124 |
118 } // namespace chrome | 125 } // namespace chrome |
OLD | NEW |