| 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool ContextFeatures::mutationEventsEnabled(Document* document) | 58 bool ContextFeatures::mutationEventsEnabled(Document* document) |
| 59 { | 59 { |
| 60 ASSERT(document); | 60 ASSERT(document); |
| 61 if (!document) | 61 if (!document) |
| 62 return true; | 62 return true; |
| 63 return document->contextFeatures().isEnabled(document, MutationEvents, true)
; | 63 return document->contextFeatures().isEnabled(document, MutationEvents, true)
; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> clie
nt) | 66 void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> clie
nt) |
| 67 { | 67 { |
| 68 ContextFeatures::SupplementType::provideTo(page, ContextFeatures::supplement
Name(), ContextFeatures::create(client)); | 68 Supplement<Page>::provideTo(page, ContextFeatures::supplementName(), Context
Features::create(client)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) | 71 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) |
| 72 { | 72 { |
| 73 ContextFeatures* provided = static_cast<ContextFeatures*>(ContextFeatures::S
upplementType::from(page, ContextFeatures::supplementName())); | 73 ContextFeatures* provided = static_cast<ContextFeatures*>(Supplement<Page>::
from(page, ContextFeatures::supplementName())); |
| 74 if (!provided) | 74 if (!provided) |
| 75 return; | 75 return; |
| 76 document.setContextFeatures(*provided); | 76 document.setContextFeatures(*provided); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |