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

Unified Diff: Source/core/frame/ViewportChangeNotifier.h

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oilpan comments 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/ViewportChangeNotifier.h
diff --git a/Source/core/frame/ViewportChangeNotifier.h b/Source/core/frame/ViewportChangeNotifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..8722b3f24aface91a7b83cc42099f95cb78117c9
--- /dev/null
+++ b/Source/core/frame/ViewportChangeNotifier.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ViewportChangeNotifier_h
+#define ViewportChangeNotifier_h
+
+#include "platform/heap/Handle.h"
+
+namespace WebCore {
+
+class ViewportChangeListener : public RefCountedWillBeGarbageCollected<ViewportChangeListener> {
esprehn 2014/07/14 08:39:49 This is just a duplicate of what the mediaQuery th
+public:
+ virtual void viewportChanged() = 0;
sof 2014/07/14 20:38:08 All classes that directly derive from a garbage co
+ DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(ViewportChangeListener);
+};
+
+class ViewportChangeNotifier : public NoBaseWillBeGarbageCollected<ViewportChangeNotifier> {
+public:
+ static PassOwnPtrWillBeRawPtr<ViewportChangeNotifier> create();
+ void addListener(ViewportChangeListener*);
+ void removeListener(ViewportChangeListener*);
+ void viewportChanged();
+
+ typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<ViewportChangeListener> > ListenerContainer;
+
+private:
+ ViewportChangeNotifier() { };
sof 2014/07/14 20:38:09 nit: redundant semicolon.
+ void trace(Visitor*);
sof 2014/07/14 20:38:08 Make this a public method.
+
+ ListenerContainer m_listeners;
+};
+
+} // namespace
+
+#endif // MediaQueryBlockWatcher_h

Powered by Google App Engine
This is Rietveld 408576698