Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 class MediaQueryListListener; | 32 class MediaQueryListListener; |
| 33 class MediaQueryEvaluator; | 33 class MediaQueryEvaluator; |
| 34 class MediaQuerySet; | 34 class MediaQuerySet; |
| 35 | 35 |
| 36 // MediaQueryMatcher class is responsible for keeping a vector of pairs | 36 // MediaQueryMatcher class is responsible for keeping a vector of pairs |
| 37 // MediaQueryList x MediaQueryListListener. It is responsible for evaluating the queries | 37 // MediaQueryList x MediaQueryListListener. It is responsible for evaluating the queries |
| 38 // whenever it is needed and to call the listeners if the corresponding query ha s changed. | 38 // whenever it is needed and to call the listeners if the corresponding query ha s changed. |
| 39 // The listeners must be called in the very same order in which they have been a dded. | 39 // The listeners must be called in the very same order in which they have been a dded. |
| 40 | 40 |
| 41 class MediaQueryMatcher FINAL : public RefCountedWillBeGarbageCollectedFinalized <MediaQueryMatcher> { | 41 class MediaQueryMatcher FINAL : public RefCountedWillBeGarbageCollectedFinalized <MediaQueryMatcher> { |
| 42 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryMatcher); | 42 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryMatcher) |
|
haraken
2014/07/02 14:06:21
We normally add ";" though.
| |
| 43 public: | 43 public: |
| 44 static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(Document& document) { return adoptRefWillBeNoop(new MediaQueryMatcher(document)); } | 44 static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(Document&); |
| 45 void documentDetached(); | 45 void documentDetached(); |
| 46 | 46 |
| 47 void addMediaQueryList(MediaQueryList*); | 47 void addMediaQueryList(MediaQueryList*); |
| 48 void removeMediaQueryList(MediaQueryList*); | 48 void removeMediaQueryList(MediaQueryList*); |
| 49 | 49 |
| 50 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); | 50 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); |
| 51 | 51 |
| 52 void mediaFeaturesChanged(); | 52 void mediaFeaturesChanged(); |
| 53 bool evaluate(const MediaQuerySet*); | 53 bool evaluate(const MediaQuerySet*); |
| 54 | 54 |
| 55 void trace(Visitor*); | 55 void trace(Visitor*); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 explicit MediaQueryMatcher(Document&); | 58 explicit MediaQueryMatcher(Document&); |
| 59 | 59 |
| 60 PassOwnPtr<MediaQueryEvaluator> createEvaluator() const; | 60 PassOwnPtr<MediaQueryEvaluator> createEvaluator() const; |
| 61 | 61 |
| 62 RawPtrWillBeMember<Document> m_document; | 62 RawPtrWillBeMember<Document> m_document; |
| 63 OwnPtr<MediaQueryEvaluator> m_evaluator; | 63 OwnPtr<MediaQueryEvaluator> m_evaluator; |
| 64 | 64 |
| 65 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryList> > Med iaQueryListSet; | 65 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryList> > Med iaQueryListSet; |
| 66 MediaQueryListSet m_mediaLists; | 66 MediaQueryListSet m_mediaLists; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } | 69 } |
| 70 | 70 |
| 71 #endif // MediaQueryMatcher_h | 71 #endif // MediaQueryMatcher_h |
| OLD | NEW |