| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 ContextFeaturesCache::from(*document).validateAgainst(document); | 137 ContextFeaturesCache::from(*document).validateAgainst(document); |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatur
es::FeatureType type, bool defaultValue) | 140 bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatur
es::FeatureType type, bool defaultValue) |
| 141 { | 141 { |
| 142 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(document->frame()); | 142 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(document->frame()); |
| 143 if (!frame || !frame->permissionClient()) | 143 if (!frame || !frame->permissionClient()) |
| 144 return defaultValue; | 144 return defaultValue; |
| 145 | 145 |
| 146 switch (type) { | 146 switch (type) { |
| 147 case ContextFeatures::StyleScoped: |
| 148 return frame->permissionClient()->allowWebComponents(defaultValue); |
| 147 case ContextFeatures::MutationEvents: | 149 case ContextFeatures::MutationEvents: |
| 148 return frame->permissionClient()->allowMutationEvents(defaultValue); | 150 return frame->permissionClient()->allowMutationEvents(defaultValue); |
| 149 case ContextFeatures::PushState: | 151 case ContextFeatures::PushState: |
| 150 return frame->permissionClient()->allowPushState(); | 152 return frame->permissionClient()->allowPushState(); |
| 151 default: | 153 default: |
| 152 return defaultValue; | 154 return defaultValue; |
| 153 } | 155 } |
| 154 } | 156 } |
| 155 | 157 |
| 156 } // namespace blink | 158 } // namespace blink |
| OLD | NEW |