| 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 "chrome/common/url_constants.h" | 5 #include "chrome/common/url_constants.h" |
| 6 | 6 |
| 7 #include "googleurl/src/url_util.h" | 7 #include "googleurl/src/url_util.h" |
| 8 | 8 |
| 9 namespace { |
| 10 const char* kSavableSchemes[] = { |
| 11 chrome::kExtensionScheme, |
| 12 NULL |
| 13 }; |
| 14 } // namespace |
| 15 |
| 9 namespace chrome { | 16 namespace chrome { |
| 10 | 17 |
| 11 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 12 const char kCrosScheme[] = "cros"; | 19 const char kCrosScheme[] = "cros"; |
| 13 #endif | 20 #endif |
| 14 | 21 |
| 15 const char kAboutPluginsURL[] = "about:plugins"; | 22 const char kAboutPluginsURL[] = "about:plugins"; |
| 16 const char kAboutVersionURL[] = "about:version"; | 23 const char kAboutVersionURL[] = "about:version"; |
| 17 | 24 |
| 18 // Add Chrome UI URLs as necessary, in alphabetical order. | 25 // Add Chrome UI URLs as necessary, in alphabetical order. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 kChromeUICrashURL, | 320 kChromeUICrashURL, |
| 314 kChromeUIKillURL, | 321 kChromeUIKillURL, |
| 315 kChromeUIHangURL, | 322 kChromeUIHangURL, |
| 316 kChromeUIShorthangURL, | 323 kChromeUIShorthangURL, |
| 317 kChromeUIGpuCleanURL, | 324 kChromeUIGpuCleanURL, |
| 318 kChromeUIGpuCrashURL, | 325 kChromeUIGpuCrashURL, |
| 319 kChromeUIGpuHangURL, | 326 kChromeUIGpuHangURL, |
| 320 }; | 327 }; |
| 321 int kNumberOfChromeDebugURLs = static_cast<int>(arraysize(kChromeDebugURLs)); | 328 int kNumberOfChromeDebugURLs = static_cast<int>(arraysize(kChromeDebugURLs)); |
| 322 | 329 |
| 330 const char kExtensionScheme[] = "chrome-extension"; |
| 331 |
| 323 void RegisterChromeSchemes() { | 332 void RegisterChromeSchemes() { |
| 324 // Don't need "chrome-internal" which was used in old versions of Chrome for | |
| 325 // the new tab page. | |
| 326 url_util::AddStandardScheme(kChromeDevToolsScheme); | |
| 327 url_util::AddStandardScheme(kChromeUIScheme); | |
| 328 url_util::AddStandardScheme(kExtensionScheme); | 333 url_util::AddStandardScheme(kExtensionScheme); |
| 329 url_util::AddStandardScheme(kMetadataScheme); | |
| 330 #if defined(OS_CHROMEOS) | 334 #if defined(OS_CHROMEOS) |
| 331 url_util::AddStandardScheme(kCrosScheme); | 335 url_util::AddStandardScheme(kCrosScheme); |
| 332 #endif | 336 #endif |
| 333 | 337 |
| 334 // Prevent future modification of the standard schemes list. This is to | 338 // This call will also lock the list of standard schemes. |
| 335 // prevent accidental creation of data races in the program. AddStandardScheme | 339 RegisterContentSchemes(kSavableSchemes); |
| 336 // isn't threadsafe so must be called when GURL isn't used on any other | |
| 337 // thread. This is really easy to mess up, so we say that all calls to | |
| 338 // AddStandardScheme in Chrome must be inside this function. | |
| 339 url_util::LockStandardSchemes(); | |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace chrome | 342 } // namespace chrome |
| OLD | NEW |