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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 bool ContextFeatures::styleScopedEnabled(Document* document) | 60 bool ContextFeatures::styleScopedEnabled(Document* document) |
61 { | 61 { |
62 if (!document) | 62 if (!document) |
63 return RuntimeEnabledFeatures::styleScopedEnabled(); | 63 return RuntimeEnabledFeatures::styleScopedEnabled(); |
64 return document->contextFeatures()->isEnabled(document, StyleScoped, Runtime
EnabledFeatures::styleScopedEnabled()); | 64 return document->contextFeatures()->isEnabled(document, StyleScoped, Runtime
EnabledFeatures::styleScopedEnabled()); |
65 } | 65 } |
66 | 66 |
67 bool ContextFeatures::pagePopupEnabled(Document* document) | 67 bool ContextFeatures::pagePopupEnabled(Document* document) |
68 { | 68 { |
69 #if ENABLE(PAGE_POPUP) | |
70 if (!document) | 69 if (!document) |
71 return false; | 70 return false; |
72 return document->contextFeatures()->isEnabled(document, PagePopup, false); | 71 return document->contextFeatures()->isEnabled(document, PagePopup, false); |
73 #else | |
74 UNUSED_PARAM(document); | |
75 return false; | |
76 #endif | |
77 } | 72 } |
78 | 73 |
79 bool ContextFeatures::htmlNotificationsEnabled(Document* document) | 74 bool ContextFeatures::htmlNotificationsEnabled(Document* document) |
80 { | 75 { |
81 #if ENABLE(LEGACY_NOTIFICATIONS) | 76 #if ENABLE(LEGACY_NOTIFICATIONS) |
82 if (!document) | 77 if (!document) |
83 return false; | 78 return false; |
84 return document->contextFeatures()->isEnabled(document, HTMLNotifications, f
alse); | 79 return document->contextFeatures()->isEnabled(document, HTMLNotifications, f
alse); |
85 #else | 80 #else |
86 UNUSED_PARAM(document); | 81 UNUSED_PARAM(document); |
(...skipping 21 matching lines...) Expand all Loading... |
108 | 103 |
109 void provideContextFeaturesToDocumentFrom(Document* document, Page* page) | 104 void provideContextFeaturesToDocumentFrom(Document* document, Page* page) |
110 { | 105 { |
111 ContextFeatures* provided = static_cast<ContextFeatures*>(RefCountedSuppleme
nt<Page, ContextFeatures>::from(page, ContextFeatures::supplementName())); | 106 ContextFeatures* provided = static_cast<ContextFeatures*>(RefCountedSuppleme
nt<Page, ContextFeatures>::from(page, ContextFeatures::supplementName())); |
112 if (!provided) | 107 if (!provided) |
113 return; | 108 return; |
114 document->setContextFeatures(provided); | 109 document->setContextFeatures(provided); |
115 } | 110 } |
116 | 111 |
117 } | 112 } |
OLD | NEW |