Chromium Code Reviews| 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 |