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 "content/common/savable_url_schemes.h" | 7 #include "content/common/savable_url_schemes.h" |
| 8 #include "googleurl/src/gurl.h" |
8 | 9 |
9 namespace chrome { | 10 namespace chrome { |
10 | 11 |
11 const char kAboutScheme[] = "about"; | 12 const char kAboutScheme[] = "about"; |
12 const char kBlobScheme[] = "blob"; | 13 const char kBlobScheme[] = "blob"; |
13 | 14 |
14 // Before adding new chrome schemes please check with security@chromium.org. | 15 // Before adding new chrome schemes please check with security@chromium.org. |
15 // There are security implications associated with introducing new schemes. | 16 // There are security implications associated with introducing new schemes. |
16 const char kChromeDevToolsScheme[] = "chrome-devtools"; | 17 const char kChromeDevToolsScheme[] = "chrome-devtools"; |
17 const char kChromeInternalScheme[] = "chrome-internal"; | 18 const char kChromeInternalScheme[] = "chrome-internal"; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 66 |
66 // This URL is loaded when a page is swapped out and replaced by a page in a | 67 // 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 | 68 // different renderer process. It must have a unique origin that cannot be |
68 // scripted by other pages in the process. | 69 // scripted by other pages in the process. |
69 const char kSwappedOutURL[] = "swappedout://"; | 70 const char kSwappedOutURL[] = "swappedout://"; |
70 | 71 |
71 const char* const* GetSavableSchemes() { | 72 const char* const* GetSavableSchemes() { |
72 return GetSavableSchemesInternal(); | 73 return GetSavableSchemesInternal(); |
73 } | 74 } |
74 | 75 |
| 76 bool HasWebUIScheme(const GURL& url) { |
| 77 return |
| 78 #if !defined(OS_IOS) |
| 79 url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 80 url.SchemeIs(chrome::kChromeInternalScheme) || |
| 81 #endif |
| 82 url.SchemeIs(chrome::kChromeUIScheme); |
| 83 } |
| 84 |
75 } // namespace content | 85 } // namespace content |
OLD | NEW |