| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014, Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014, Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 KURL kurl = document.completeURL(url); | 86 KURL kurl = document.completeURL(url); |
| 87 | 87 |
| 88 if (kurl.isEmpty() || !kurl.isValid()) { | 88 if (kurl.isEmpty() || !kurl.isValid()) { |
| 89 exceptionState.throwDOMException(SyntaxError, "The custom handler URL cr
eated by removing '%s' and prepending '" + document.baseURL().getString() + "' i
s invalid."); | 89 exceptionState.throwDOMException(SyntaxError, "The custom handler URL cr
eated by removing '%s' and prepending '" + document.baseURL().getString() + "' i
s invalid."); |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // The specification says that the API throws SecurityError exception if the | 93 // The specification says that the API throws SecurityError exception if the |
| 94 // URL's origin differs from the document's origin. | 94 // URL's origin differs from the document's origin. |
| 95 if (!document.securityOrigin()->canRequest(kurl)) { | 95 if (!document.getSecurityOrigin()->canRequest(kurl)) { |
| 96 exceptionState.throwSecurityError("Can only register custom handler in t
he document's origin."); | 96 exceptionState.throwSecurityError("Can only register custom handler in t
he document's origin."); |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 static bool isSchemeWhitelisted(const String& scheme) | 103 static bool isSchemeWhitelisted(const String& scheme) |
| 104 { | 104 { |
| 105 if (!schemeWhitelist) | 105 if (!schemeWhitelist) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 228 { |
| 229 return "NavigatorContentUtils"; | 229 return "NavigatorContentUtils"; |
| 230 } | 230 } |
| 231 | 231 |
| 232 void provideNavigatorContentUtilsTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<Na
vigatorContentUtilsClient> client) | 232 void provideNavigatorContentUtilsTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<Na
vigatorContentUtilsClient> client) |
| 233 { | 233 { |
| 234 NavigatorContentUtils::provideTo(frame, NavigatorContentUtils::supplementNam
e(), NavigatorContentUtils::create(client)); | 234 NavigatorContentUtils::provideTo(frame, NavigatorContentUtils::supplementNam
e(), NavigatorContentUtils::create(client)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |