OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // These two functions are provided for compatibility with JS code | 56 // These two functions are provided for compatibility with JS code |
57 // written before the change listener became a DOM event. | 57 // written before the change listener became a DOM event. |
58 void addDeprecatedListener(PassRefPtr<EventListener>); | 58 void addDeprecatedListener(PassRefPtr<EventListener>); |
59 void removeDeprecatedListener(PassRefPtr<EventListener>); | 59 void removeDeprecatedListener(PassRefPtr<EventListener>); |
60 | 60 |
61 // C++ code can use these functions to listen to changes instead of having t
o use DOM event listeners. | 61 // C++ code can use these functions to listen to changes instead of having t
o use DOM event listeners. |
62 void addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); | 62 void addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); |
63 void removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); | 63 void removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); |
64 | 64 |
65 // Will return true if a DOM event should be scheduled. | 65 // Will return true if a DOM event should be scheduled. |
66 bool mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryList
Listener> >* listenersToNotify); | 66 bool mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryList
Listener>>* listenersToNotify); |
67 | 67 |
68 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
69 | 69 |
70 // From ActiveDOMObject | 70 // From ActiveDOMObject |
71 virtual bool hasPendingActivity() const override; | 71 virtual bool hasPendingActivity() const override; |
72 virtual void stop() override; | 72 virtual void stop() override; |
73 | 73 |
74 virtual const AtomicString& interfaceName() const override; | 74 virtual const AtomicString& interfaceName() const override; |
75 virtual ExecutionContext* executionContext() const override; | 75 virtual ExecutionContext* executionContext() const override; |
76 | 76 |
77 private: | 77 private: |
78 MediaQueryList(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaQueryMatcher>,
PassRefPtrWillBeRawPtr<MediaQuerySet>); | 78 MediaQueryList(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaQueryMatcher>,
PassRefPtrWillBeRawPtr<MediaQuerySet>); |
79 | 79 |
80 bool updateMatches(); | 80 bool updateMatches(); |
81 | 81 |
82 RefPtrWillBeMember<MediaQueryMatcher> m_matcher; | 82 RefPtrWillBeMember<MediaQueryMatcher> m_matcher; |
83 RefPtrWillBeMember<MediaQuerySet> m_media; | 83 RefPtrWillBeMember<MediaQuerySet> m_media; |
84 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener> > L
istenerList; | 84 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener>> Li
stenerList; |
85 ListenerList m_listeners; | 85 ListenerList m_listeners; |
86 bool m_matchesDirty; | 86 bool m_matchesDirty; |
87 bool m_matches; | 87 bool m_matches; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
91 | 91 |
92 #endif // MediaQueryList_h | 92 #endif // MediaQueryList_h |
OLD | NEW |