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 19 matching lines...) Expand all Loading... |
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( | 33 GetContentClient()->AddAdditionalSchemes( |
34 &additional_standard_schemes, | 34 &additional_standard_schemes, |
35 &additional_savable_schemes); | 35 &additional_savable_schemes); |
36 | 36 |
37 // Don't need "chrome-internal" which was used in old versions of Chrome for | 37 // Don't need "chrome-internal" which was used in old versions of Chrome for |
38 // the new tab page. | 38 // the new tab page. |
39 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); | 39 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); |
40 url_util::AddStandardScheme(chrome::kChromeSearchScheme); | |
41 url_util::AddStandardScheme(chrome::kChromeUIScheme); | 40 url_util::AddStandardScheme(chrome::kChromeUIScheme); |
42 url_util::AddStandardScheme(chrome::kMetadataScheme); | 41 url_util::AddStandardScheme(chrome::kMetadataScheme); |
43 url_util::AddStandardScheme(chrome::kGuestScheme); | 42 url_util::AddStandardScheme(chrome::kGuestScheme); |
44 std::for_each(additional_standard_schemes.begin(), | 43 std::for_each(additional_standard_schemes.begin(), |
45 additional_standard_schemes.end(), | 44 additional_standard_schemes.end(), |
46 AddStandardSchemeHelper); | 45 AddStandardSchemeHelper); |
47 | 46 |
48 // Prevent future modification of the standard schemes list. This is to | 47 // Prevent future modification of the standard schemes list. This is to |
49 // prevent accidental creation of data races in the program. AddStandardScheme | 48 // prevent accidental creation of data races in the program. AddStandardScheme |
50 // isn't threadsafe so must be called when GURL isn't used on any other | 49 // isn't threadsafe so must be called when GURL isn't used on any other |
(...skipping 21 matching lines...) Expand all Loading... |
72 savable_schemes[default_schemes_count + i] = | 71 savable_schemes[default_schemes_count + i] = |
73 base::strdup(additional_savable_schemes[i].c_str()); | 72 base::strdup(additional_savable_schemes[i].c_str()); |
74 } | 73 } |
75 savable_schemes[default_schemes_count + schemes] = 0; | 74 savable_schemes[default_schemes_count + schemes] = 0; |
76 | 75 |
77 SetSavableSchemes(savable_schemes); | 76 SetSavableSchemes(savable_schemes); |
78 } | 77 } |
79 } | 78 } |
80 | 79 |
81 } // namespace content | 80 } // namespace content |
OLD | NEW |