| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { | 61 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { |
| 62 flags &= ~SandboxOrientationLock; | 62 flags &= ~SandboxOrientationLock; |
| 63 } else if (equalIgnoringCase(sandboxToken, | 63 } else if (equalIgnoringCase(sandboxToken, |
| 64 "allow-popups-to-escape-sandbox")) { | 64 "allow-popups-to-escape-sandbox")) { |
| 65 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; | 65 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; |
| 66 } else if (equalIgnoringCase(sandboxToken, "allow-modals")) { | 66 } else if (equalIgnoringCase(sandboxToken, "allow-modals")) { |
| 67 flags &= ~SandboxModals; | 67 flags &= ~SandboxModals; |
| 68 } else if (equalIgnoringCase(sandboxToken, "allow-presentation")) { | 68 } else if (equalIgnoringCase(sandboxToken, "allow-presentation")) { |
| 69 flags &= ~SandboxPresentation; | 69 flags &= ~SandboxPresentation; |
| 70 } else if (equalIgnoringCase(sandboxToken, | 70 } else if (equalIgnoringCase(sandboxToken, |
| 71 "allow-top-navigation-with-user-activation") && | 71 "allow-top-navigation-by-user-activation") && |
| 72 RuntimeEnabledFeatures:: | 72 RuntimeEnabledFeatures:: |
| 73 topNavWithUserActivationInSandboxEnabled()) { | 73 topNavByUserActivationInSandboxEnabled()) { |
| 74 flags &= ~SandboxTopNavigationWithUserActivation; | 74 flags &= ~SandboxTopNavigationByUserActivation; |
| 75 } else { | 75 } else { |
| 76 tokenErrors.append(tokenErrors.isEmpty() ? "'" : ", '"); | 76 tokenErrors.append(tokenErrors.isEmpty() ? "'" : ", '"); |
| 77 tokenErrors.append(sandboxToken); | 77 tokenErrors.append(sandboxToken); |
| 78 tokenErrors.append("'"); | 78 tokenErrors.append("'"); |
| 79 numberOfTokenErrors++; | 79 numberOfTokenErrors++; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 if (numberOfTokenErrors) { | 83 if (numberOfTokenErrors) { |
| 84 tokenErrors.append(numberOfTokenErrors > 1 | 84 tokenErrors.append(numberOfTokenErrors > 1 |
| 85 ? " are invalid sandbox flags." | 85 ? " are invalid sandbox flags." |
| 86 : " is an invalid sandbox flag."); | 86 : " is an invalid sandbox flag."); |
| 87 invalidTokensErrorMessage = tokenErrors.toString(); | 87 invalidTokensErrorMessage = tokenErrors.toString(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 return flags; | 90 return flags; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |