OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SnapManagerBridge_h |
| 6 #define SnapManagerBridge_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" |
| 9 #include "core/page/scrolling/SnapCoordinator.h" |
| 10 #include "platform/heap/Handle.h" |
| 11 #include "wtf/RefCounted.h" |
| 12 #include "wtf/Vector.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class Document; |
| 17 class Node; |
| 18 class Element; |
| 19 class ScriptValue; |
| 20 |
| 21 // Represents the PrivateScript implementation of snap manager. |
| 22 class CORE_EXPORT SnapManagerBridge : public GarbageCollectedFinalized<SnapManag
erBridge>, public SnapCoordinator::Client { |
| 23 public: |
| 24 static SnapManagerBridge* create(const Document* document) |
| 25 { |
| 26 return new SnapManagerBridge(document); |
| 27 } |
| 28 virtual ~SnapManagerBridge() {} |
| 29 |
| 30 // Delegates to implementation in private script |
| 31 void didUpdateSnapOffsets(const LayoutBox&, SnapOffsets) override; |
| 32 |
| 33 // Invoked from private script |
| 34 Vector<Element*> getUpdatedSnapContainers(); |
| 35 |
| 36 DEFINE_INLINE_TRACE() |
| 37 { |
| 38 visitor->trace(m_document); |
| 39 } |
| 40 |
| 41 private: |
| 42 explicit SnapManagerBridge(const Document*); |
| 43 Member<const Document> m_document; |
| 44 RefPtr<ScriptState> m_scriptState; |
| 45 |
| 46 // The snap manager instance |
| 47 ScriptValue m_instance; |
| 48 |
| 49 void maybeCreateSnapManagerInstance(); |
| 50 }; |
| 51 |
| 52 } // namespace blink |
| 53 |
| 54 #endif |
OLD | NEW |