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/public/common/url_constants.h" | 5 #include "content/public/common/url_constants.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "googleurl/src/url_util.h" | 8 #include "googleurl/src/url_util.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const char kChromeUINetworkViewCacheHost[] = "view-http-cache"; | 52 const char kChromeUINetworkViewCacheHost[] = "view-http-cache"; |
53 const char kChromeUICrashURL[] = "chrome://crash"; | 53 const char kChromeUICrashURL[] = "chrome://crash"; |
54 const char kChromeUIGpuCleanURL[] = "chrome://gpuclean"; | 54 const char kChromeUIGpuCleanURL[] = "chrome://gpuclean"; |
55 const char kChromeUIGpuCrashURL[] = "chrome://gpucrash"; | 55 const char kChromeUIGpuCrashURL[] = "chrome://gpucrash"; |
56 const char kChromeUIGpuHangURL[] = "chrome://gpuhang"; | 56 const char kChromeUIGpuHangURL[] = "chrome://gpuhang"; |
57 const char kChromeUIHangURL[] = "chrome://hang"; | 57 const char kChromeUIHangURL[] = "chrome://hang"; |
58 const char kChromeUIKillURL[] = "chrome://kill"; | 58 const char kChromeUIKillURL[] = "chrome://kill"; |
59 const char kChromeUINetworkViewCacheURL[] = "chrome://view-http-cache/"; | 59 const char kChromeUINetworkViewCacheURL[] = "chrome://view-http-cache/"; |
60 const char kChromeUIShorthangURL[] = "chrome://shorthang"; | 60 const char kChromeUIShorthangURL[] = "chrome://shorthang"; |
61 | 61 |
| 62 } // namespace chrome |
| 63 |
| 64 namespace content { |
| 65 |
62 // This error URL is loaded in normal web renderer processes, so it should not | 66 // This error URL is loaded in normal web renderer processes, so it should not |
63 // have a chrome:// scheme that might let it be confused with a WebUI page. | 67 // have a chrome:// scheme that might let it be confused with a WebUI page. |
64 const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata"; | 68 const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata"; |
65 | 69 |
66 // This URL is loaded when a page is swapped out and replaced by a page in a | 70 // This URL is loaded when a page is swapped out and replaced by a page in a |
67 // different renderer process. It must have a unique origin that cannot be | 71 // different renderer process. It must have a unique origin that cannot be |
68 // scripted by other pages in the process. | 72 // scripted by other pages in the process. |
69 const char kSwappedOutURL[] = "swappedout://"; | 73 const char kSwappedOutURL[] = "swappedout://"; |
70 | 74 |
71 } // namespace chrome | |
72 | |
73 namespace content { | |
74 | |
75 const char** GetSavableSchemes() { | 75 const char** GetSavableSchemes() { |
76 return const_cast<const char**>(g_savable_schemes); | 76 return const_cast<const char**>(g_savable_schemes); |
77 } | 77 } |
78 | 78 |
79 void RegisterContentSchemes(const char** additional_savable_schemes) { | 79 void RegisterContentSchemes(const char** additional_savable_schemes) { |
80 // Don't need "chrome-internal" which was used in old versions of Chrome for | 80 // Don't need "chrome-internal" which was used in old versions of Chrome for |
81 // the new tab page. | 81 // the new tab page. |
82 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); | 82 url_util::AddStandardScheme(chrome::kChromeDevToolsScheme); |
83 url_util::AddStandardScheme(chrome::kChromeUIScheme); | 83 url_util::AddStandardScheme(chrome::kChromeUIScheme); |
84 url_util::AddStandardScheme(chrome::kMetadataScheme); | 84 url_util::AddStandardScheme(chrome::kMetadataScheme); |
(...skipping 17 matching lines...) Expand all Loading... |
102 arraysize(kDefaultSavableSchemes) * sizeof(char*)); | 102 arraysize(kDefaultSavableSchemes) * sizeof(char*)); |
103 for (int i = 0; i < schemes; ++i) { | 103 for (int i = 0; i < schemes; ++i) { |
104 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] = | 104 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] = |
105 base::strdup(additional_savable_schemes[i]); | 105 base::strdup(additional_savable_schemes[i]); |
106 } | 106 } |
107 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0; | 107 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 } // namespace content | 111 } // namespace content |
OLD | NEW |