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

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: 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 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..f8fc8659c793373ddff641359340f4bcd88d6e9c
--- /dev/null
+++ b/Source/core/frame/ViewportChangeNotifier.h
@@ -0,0 +1,35 @@
+// 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> {
+public:
+ virtual void viewportChanged() = 0;
+ virtual ~ViewportChangeListener() { }
haraken 2014/07/11 06:10:21 You'll need to use DECLARE_EMPTY_VIRTUAL_DESTRUCTO
+};
+
+class ViewportChangeNotifier {
haraken 2014/07/11 06:10:21 This should be: class ViewportChangeNotifier : pu
+public:
+ static PassOwnPtrWillBeRawPtr<ViewportChangeNotifier> create();
+ void addListener(PassRefPtrWillBeRawPtr<ViewportChangeListener>);
+ void removeListener(PassRefPtrWillBeRawPtr<ViewportChangeListener>);
+ void viewportChanged();
+
+ typedef WillBeHeapHashSet<RefPtrWillBeMember<ViewportChangeListener> > ListenerContainer;
+
+private:
+ ViewportChangeNotifier() { };
+
+ ListenerContainer m_listeners;
haraken 2014/07/11 06:10:21 You need to add a trace() method and trace m_liste
+};
+
+} // namespace
+
+#endif // MediaQueryBlockWatcher_h

Powered by Google App Engine
This is Rietveld 408576698