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