OLD | NEW |
1 // Copyright (c) 2011 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 { |
11 const char* kDefaultSavableSchemes[] = { | 11 const char* kDefaultSavableSchemes[] = { |
(...skipping 27 matching lines...) Expand all Loading... |
39 const char kJavaScriptScheme[] = "javascript"; | 39 const char kJavaScriptScheme[] = "javascript"; |
40 const char kMailToScheme[] = "mailto"; | 40 const char kMailToScheme[] = "mailto"; |
41 const char kMetadataScheme[] = "metadata"; | 41 const char kMetadataScheme[] = "metadata"; |
42 const char kViewSourceScheme[] = "view-source"; | 42 const char kViewSourceScheme[] = "view-source"; |
43 | 43 |
44 const char kStandardSchemeSeparator[] = "://"; | 44 const char kStandardSchemeSeparator[] = "://"; |
45 | 45 |
46 const char kAboutBlankURL[] = "about:blank"; | 46 const char kAboutBlankURL[] = "about:blank"; |
47 const char kAboutCrashURL[] = "about:crash"; | 47 const char kAboutCrashURL[] = "about:crash"; |
48 | 48 |
49 const char kUnreachableWebDataURL[] = "chrome://chromewebdata/"; | 49 // This error URL is loaded in normal web renderer processes, so it should not |
| 50 // have a chrome:// scheme that might let it be confused with a WebUI page. |
| 51 const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata"; |
50 | 52 |
51 const char** GetSavableSchemes() { | 53 const char** GetSavableSchemes() { |
52 return const_cast<const char**>(g_savable_schemes); | 54 return const_cast<const char**>(g_savable_schemes); |
53 } | 55 } |
54 | 56 |
55 void RegisterContentSchemes(const char** additional_savable_schemes) { | 57 void RegisterContentSchemes(const char** additional_savable_schemes) { |
56 // Don't need "chrome-internal" which was used in old versions of Chrome for | 58 // Don't need "chrome-internal" which was used in old versions of Chrome for |
57 // the new tab page. | 59 // the new tab page. |
58 url_util::AddStandardScheme(kChromeDevToolsScheme); | 60 url_util::AddStandardScheme(kChromeDevToolsScheme); |
59 url_util::AddStandardScheme(kChromeUIScheme); | 61 url_util::AddStandardScheme(kChromeUIScheme); |
(...skipping 18 matching lines...) Expand all Loading... |
78 arraysize(kDefaultSavableSchemes) * sizeof(char*)); | 80 arraysize(kDefaultSavableSchemes) * sizeof(char*)); |
79 for (int i = 0; i < schemes; ++i) { | 81 for (int i = 0; i < schemes; ++i) { |
80 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] = | 82 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] = |
81 base::strdup(additional_savable_schemes[i]); | 83 base::strdup(additional_savable_schemes[i]); |
82 } | 84 } |
83 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0; | 85 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0; |
84 } | 86 } |
85 } | 87 } |
86 | 88 |
87 } // namespace chrome | 89 } // namespace chrome |
OLD | NEW |