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..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 |