| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/url_schemes.h" | 5 #include "content/common/url_schemes.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 void RegisterContentSchemes(bool lock_standard_schemes) { | 30 void RegisterContentSchemes(bool lock_standard_schemes) { |
| 31 std::vector<std::string> additional_standard_schemes; | 31 std::vector<std::string> additional_standard_schemes; |
| 32 std::vector<std::string> additional_savable_schemes; | 32 std::vector<std::string> additional_savable_schemes; |
| 33 GetContentClient()->AddAdditionalSchemes(&additional_standard_schemes, | 33 GetContentClient()->AddAdditionalSchemes(&additional_standard_schemes, |
| 34 &additional_savable_schemes); | 34 &additional_savable_schemes); |
| 35 | 35 |
| 36 // Don't need "chrome-internal" which was used in old versions of Chrome for | |
| 37 // the new tab page. | |
| 38 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); | 36 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); |
| 39 url_util::AddStandardScheme(chrome::kChromeUIScheme); | 37 url_util::AddStandardScheme(chrome::kChromeUIScheme); |
| 40 url_util::AddStandardScheme(kGuestScheme); | 38 url_util::AddStandardScheme(kGuestScheme); |
| 41 url_util::AddStandardScheme(kMetadataScheme); | 39 url_util::AddStandardScheme(kMetadataScheme); |
| 42 std::for_each(additional_standard_schemes.begin(), | 40 std::for_each(additional_standard_schemes.begin(), |
| 43 additional_standard_schemes.end(), | 41 additional_standard_schemes.end(), |
| 44 AddStandardSchemeHelper); | 42 AddStandardSchemeHelper); |
| 45 | 43 |
| 46 // Prevent future modification of the standard schemes list. This is to | 44 // Prevent future modification of the standard schemes list. This is to |
| 47 // prevent accidental creation of data races in the program. AddStandardScheme | 45 // prevent accidental creation of data races in the program. AddStandardScheme |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 savable_schemes[default_schemes_count + i] = | 68 savable_schemes[default_schemes_count + i] = |
| 71 base::strdup(additional_savable_schemes[i].c_str()); | 69 base::strdup(additional_savable_schemes[i].c_str()); |
| 72 } | 70 } |
| 73 savable_schemes[default_schemes_count + schemes] = 0; | 71 savable_schemes[default_schemes_count + schemes] = 0; |
| 74 | 72 |
| 75 SetSavableSchemes(savable_schemes); | 73 SetSavableSchemes(savable_schemes); |
| 76 } | 74 } |
| 77 } | 75 } |
| 78 | 76 |
| 79 } // namespace content | 77 } // namespace content |
| OLD | NEW |