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 22 matching lines...) Expand all Loading... |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class ContextFeaturesClient; | 35 class ContextFeaturesClient; |
36 class Document; | 36 class Document; |
37 class Page; | 37 class Page; |
38 | 38 |
39 class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> { | 39 class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> { |
40 public: | 40 public: |
41 enum FeatureType { | 41 enum FeatureType { |
42 DialogElement = 0, | 42 DialogElement = 0, |
| 43 ShadowDOM, |
43 StyleScoped, | 44 StyleScoped, |
44 PagePopup, | 45 PagePopup, |
45 HTMLNotifications, | 46 HTMLNotifications, |
46 MutationEvents, | 47 MutationEvents, |
47 PushState, | 48 PushState, |
48 FeatureTypeSize // Should be the last entry. | 49 FeatureTypeSize // Should be the last entry. |
49 }; | 50 }; |
50 | 51 |
51 static const AtomicString& supplementName(); | 52 static const AtomicString& supplementName(); |
52 static ContextFeatures* defaultSwitch(); | 53 static ContextFeatures* defaultSwitch(); |
53 static PassRefPtr<ContextFeatures> create(ContextFeaturesClient*); | 54 static PassRefPtr<ContextFeatures> create(ContextFeaturesClient*); |
54 | 55 |
55 static bool dialogElementEnabled(Document*); | 56 static bool dialogElementEnabled(Document*); |
| 57 static bool shadowDOMEnabled(Document*); |
56 static bool styleScopedEnabled(Document*); | 58 static bool styleScopedEnabled(Document*); |
57 static bool pagePopupEnabled(Document*); | 59 static bool pagePopupEnabled(Document*); |
58 static bool htmlNotificationsEnabled(Document*); | 60 static bool htmlNotificationsEnabled(Document*); |
59 static bool mutationEventsEnabled(Document*); | 61 static bool mutationEventsEnabled(Document*); |
60 static bool pushStateEnabled(Document*); | 62 static bool pushStateEnabled(Document*); |
61 | 63 |
62 bool isEnabled(Document*, FeatureType, bool) const; | 64 bool isEnabled(Document*, FeatureType, bool) const; |
63 void urlDidChange(Document*); | 65 void urlDidChange(Document*); |
64 | 66 |
65 private: | 67 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 inline void ContextFeatures::urlDidChange(Document* document) | 108 inline void ContextFeatures::urlDidChange(Document* document) |
107 { | 109 { |
108 if (m_client) | 110 if (m_client) |
109 return; | 111 return; |
110 m_client->urlDidChange(document); | 112 m_client->urlDidChange(document); |
111 } | 113 } |
112 | 114 |
113 } // namespace WebCore | 115 } // namespace WebCore |
114 | 116 |
115 #endif // ContextFeatures_h | 117 #endif // ContextFeatures_h |
OLD | NEW |