Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: Source/core/css/MediaQueryMatcher.h

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Self review nits Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
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)
43 public: 43 public:
44 static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(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 void addViewportListener(MediaQueryListListener*);
51 void removeViewportListener(MediaQueryListListener*);
52
50 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); 53 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&);
51 54
52 void mediaFeaturesChanged(); 55 void mediaFeaturesChanged();
56 void viewportChanged();
53 bool evaluate(const MediaQuerySet*); 57 bool evaluate(const MediaQuerySet*);
54 58
55 void trace(Visitor*); 59 void trace(Visitor*);
56 60
57 private: 61 private:
58 explicit MediaQueryMatcher(Document&); 62 explicit MediaQueryMatcher(Document&);
59 63
60 PassOwnPtr<MediaQueryEvaluator> createEvaluator() const; 64 PassOwnPtr<MediaQueryEvaluator> createEvaluator() const;
61 65
62 RawPtrWillBeMember<Document> m_document; 66 RawPtrWillBeMember<Document> m_document;
63 OwnPtr<MediaQueryEvaluator> m_evaluator; 67 OwnPtr<MediaQueryEvaluator> m_evaluator;
64 68
65 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryList> > Med iaQueryListSet; 69 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryList> > Med iaQueryListSet;
66 MediaQueryListSet m_mediaLists; 70 MediaQueryListSet m_mediaLists;
71
72 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryListListene r> > ViewportListenerSet;
73 ViewportListenerSet m_viewportListeners;
67 }; 74 };
68 75
69 } 76 }
70 77
71 #endif // MediaQueryMatcher_h 78 #endif // MediaQueryMatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698