| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 bool ContextFeatures::pagePopupEnabled(Document* document) | 52 bool ContextFeatures::pagePopupEnabled(Document* document) |
| 53 { | 53 { |
| 54 if (!document) | 54 if (!document) |
| 55 return false; | 55 return false; |
| 56 return document->contextFeatures().isEnabled(document, PagePopup, false); | 56 return document->contextFeatures().isEnabled(document, PagePopup, false); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool ContextFeatures::mutationEventsEnabled(Document* document) | 59 bool ContextFeatures::mutationEventsEnabled(Document* document) |
| 60 { | 60 { |
| 61 ASSERT(document); | 61 DCHECK(document); |
| 62 if (!document) | 62 if (!document) |
| 63 return true; | 63 return true; |
| 64 return document->contextFeatures().isEnabled(document, MutationEvents, true)
; | 64 return document->contextFeatures().isEnabled(document, MutationEvents, true)
; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> clie
nt) | 67 void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> clie
nt) |
| 68 { | 68 { |
| 69 Supplement<Page>::provideTo(page, ContextFeatures::supplementName(), Context
Features::create(client)); | 69 Supplement<Page>::provideTo(page, ContextFeatures::supplementName(), Context
Features::create(client)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) | 72 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) |
| 73 { | 73 { |
| 74 ContextFeatures* provided = static_cast<ContextFeatures*>(Supplement<Page>::
from(page, ContextFeatures::supplementName())); | 74 ContextFeatures* provided = static_cast<ContextFeatures*>(Supplement<Page>::
from(page, ContextFeatures::supplementName())); |
| 75 if (!provided) | 75 if (!provided) |
| 76 return; | 76 return; |
| 77 document.setContextFeatures(*provided); | 77 document.setContextFeatures(*provided); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |