OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 kBlobScheme[] = "blob"; | 13 const char kBlobScheme[] = "blob"; |
14 const char kChromeDevToolsScheme[] = "chrome-devtools"; | 14 const char kChromeDevToolsScheme[] = "chrome-devtools"; |
15 const char kChromeInternalScheme[] = "chrome-internal"; | 15 const char kChromeInternalScheme[] = "chrome-internal"; |
16 const char kChromeUIScheme[] = "chrome"; | 16 const char kChromeUIScheme[] = "chrome"; |
17 const char kDataScheme[] = "data"; | 17 const char kDataScheme[] = "data"; |
18 const char kExtensionScheme[] = "chrome-extension"; | 18 const char kExtensionScheme[] = "chrome-extension"; |
19 const char kFileScheme[] = "file"; | 19 const char kFileScheme[] = "file"; |
20 const char kFileSystemScheme[] = "filesystem"; | 20 const char kFileSystemScheme[] = "filesystem"; |
21 const char kFtpScheme[] = "ftp"; | 21 const char kFtpScheme[] = "ftp"; |
22 const char kGearsScheme[] = "gears"; | |
23 const char kHttpScheme[] = "http"; | 22 const char kHttpScheme[] = "http"; |
24 const char kHttpsScheme[] = "https"; | 23 const char kHttpsScheme[] = "https"; |
25 const char kJavaScriptScheme[] = "javascript"; | 24 const char kJavaScriptScheme[] = "javascript"; |
26 const char kMailToScheme[] = "mailto"; | 25 const char kMailToScheme[] = "mailto"; |
27 const char kMetadataScheme[] = "metadata"; | 26 const char kMetadataScheme[] = "metadata"; |
28 const char kUserScriptScheme[] = "chrome-user-script"; | 27 const char kUserScriptScheme[] = "chrome-user-script"; |
29 const char kViewSourceScheme[] = "view-source"; | 28 const char kViewSourceScheme[] = "view-source"; |
30 | 29 |
31 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
32 const char kCrosScheme[] = "cros"; | 31 const char kCrosScheme[] = "cros"; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 "http://www.google.com/support/chrome/bin/answer.py?answer=96817"; | 244 "http://www.google.com/support/chrome/bin/answer.py?answer=96817"; |
246 | 245 |
247 const char kOutdatedPluginLearnMoreURL[] = | 246 const char kOutdatedPluginLearnMoreURL[] = |
248 "http://www.google.com/support/chrome/bin/answer.py?answer=1181003"; | 247 "http://www.google.com/support/chrome/bin/answer.py?answer=1181003"; |
249 | 248 |
250 void RegisterChromeSchemes() { | 249 void RegisterChromeSchemes() { |
251 // Don't need "chrome-internal" which was used in old versions of Chrome for | 250 // Don't need "chrome-internal" which was used in old versions of Chrome for |
252 // the new tab page. | 251 // the new tab page. |
253 url_util::AddStandardScheme(kChromeDevToolsScheme); | 252 url_util::AddStandardScheme(kChromeDevToolsScheme); |
254 url_util::AddStandardScheme(kChromeUIScheme); | 253 url_util::AddStandardScheme(kChromeUIScheme); |
255 url_util::AddStandardScheme(kGearsScheme); | |
256 url_util::AddStandardScheme(kExtensionScheme); | 254 url_util::AddStandardScheme(kExtensionScheme); |
257 url_util::AddStandardScheme(kMetadataScheme); | 255 url_util::AddStandardScheme(kMetadataScheme); |
258 #if defined(OS_CHROMEOS) | 256 #if defined(OS_CHROMEOS) |
259 url_util::AddStandardScheme(kCrosScheme); | 257 url_util::AddStandardScheme(kCrosScheme); |
260 #endif | 258 #endif |
261 | 259 |
262 // Prevent future modification of the standard schemes list. This is to | 260 // Prevent future modification of the standard schemes list. This is to |
263 // prevent accidental creation of data races in the program. AddStandardScheme | 261 // prevent accidental creation of data races in the program. AddStandardScheme |
264 // isn't threadsafe so must be called when GURL isn't used on any other | 262 // isn't threadsafe so must be called when GURL isn't used on any other |
265 // thread. This is really easy to mess up, so we say that all calls to | 263 // thread. This is really easy to mess up, so we say that all calls to |
266 // AddStandardScheme in Chrome must be inside this function. | 264 // AddStandardScheme in Chrome must be inside this function. |
267 url_util::LockStandardSchemes(); | 265 url_util::LockStandardSchemes(); |
268 } | 266 } |
269 | 267 |
270 } // namespace chrome | 268 } // namespace chrome |
OLD | NEW |