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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 60 |
60 // This URL is loaded when a page is swapped out and replaced by a page in a | 61 // This URL is loaded when a page is swapped out and replaced by a page in a |
61 // different renderer process. It must have a unique origin that cannot be | 62 // different renderer process. It must have a unique origin that cannot be |
62 // scripted by other pages in the process. | 63 // scripted by other pages in the process. |
63 const char kSwappedOutURL[] = "swappedout://"; | 64 const char kSwappedOutURL[] = "swappedout://"; |
64 | 65 |
65 const char* const* GetSavableSchemes() { | 66 const char* const* GetSavableSchemes() { |
66 return GetSavableSchemesInternal(); | 67 return GetSavableSchemesInternal(); |
67 } | 68 } |
68 | 69 |
| 70 bool HasWebUIScheme(const GURL& url) { |
| 71 return |
| 72 #if !defined(OS_IOS) |
| 73 url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 74 url.SchemeIs(chrome::kChromeInternalScheme) || |
| 75 #endif |
| 76 url.SchemeIs(chrome::kChromeUIScheme); |
| 77 } |
| 78 |
69 } // namespace content | 79 } // namespace content |
OLD | NEW |