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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/snap/SnapManagerBridge.h

Issue 1333323003: SnapManager implementation using V8 Extras - {WIP} Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update with latest master Created 4 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698