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); | |
149 case ContextFeatures::MutationEvents: | 147 case ContextFeatures::MutationEvents: |
150 return frame->permissionClient()->allowMutationEvents(defaultValue); | 148 return frame->permissionClient()->allowMutationEvents(defaultValue); |
151 case ContextFeatures::PushState: | 149 case ContextFeatures::PushState: |
152 return frame->permissionClient()->allowPushState(); | 150 return frame->permissionClient()->allowPushState(); |
153 default: | 151 default: |
154 return defaultValue; | 152 return defaultValue; |
155 } | 153 } |
156 } | 154 } |
157 | 155 |
158 } // namespace blink | 156 } // namespace blink |
OLD | NEW |