OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be found | |
3 // in the LICENSE file. | |
4 | |
5 #ifndef RemoteBridgeFrameOwner_h | |
6 #define RemoteBridgeFrameOwner_h | |
7 | |
8 #include "core/frame/FrameOwner.h" | |
9 #include "platform/scroll/ScrollTypes.h" | |
10 #include "public/web/WebFrameOwnerProperties.h" | |
11 | |
12 namespace blink { | |
13 | |
14 // Helper class to bridge communication for a frame with a remote parent. | |
15 // Currently, it serves two purposes: | |
16 // 1. Allows the local frame's loader to retrieve sandbox flags associated with | |
17 // its owner element in another process. | |
18 // 2. Trigger a load event on its owner element once it finishes a load. | |
19 class RemoteBridgeFrameOwner final : public NoBaseWillBeGarbageCollectedFinalize
d<RemoteBridgeFrameOwner>, public FrameOwner { | |
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RemoteBridgeFrameOwner); | |
21 public: | |
22 static PassOwnPtrWillBeRawPtr<RemoteBridgeFrameOwner> create(SandboxFlags fl
ags, const WebFrameOwnerProperties& frameOwnerProperties) | |
23 { | |
24 return adoptPtrWillBeNoop(new RemoteBridgeFrameOwner(flags, frameOwnerPr
operties)); | |
25 } | |
26 | |
27 // FrameOwner overrides: | |
28 bool isLocal() const override { return false; } | |
29 void setContentFrame(Frame&) override; | |
30 void clearContentFrame() override; | |
31 SandboxFlags getSandboxFlags() const override { return m_sandboxFlags; } | |
32 void setSandboxFlags(SandboxFlags flags) { m_sandboxFlags = flags; } | |
33 void dispatchLoad() override; | |
34 // TODO(dcheng): Implement. | |
35 void renderFallbackContent() override { } | |
36 ScrollbarMode scrollingMode() const override { return m_scrolling; } | |
37 int marginWidth() const override { return m_marginWidth; } | |
38 int marginHeight() const override { return m_marginHeight; } | |
39 | |
40 void setScrollingMode(WebFrameOwnerProperties::ScrollingMode); | |
41 void setMarginWidth(int marginWidth) { m_marginWidth = marginWidth; } | |
42 void setMarginHeight(int marginHeight) { m_marginHeight = marginHeight; } | |
43 | |
44 DECLARE_VIRTUAL_TRACE(); | |
45 | |
46 private: | |
47 RemoteBridgeFrameOwner(SandboxFlags, const WebFrameOwnerProperties&); | |
48 | |
49 RawPtrWillBeMember<Frame> m_frame; | |
50 SandboxFlags m_sandboxFlags; | |
51 ScrollbarMode m_scrolling; | |
52 int m_marginWidth; | |
53 int m_marginHeight; | |
54 }; | |
55 | |
56 DEFINE_TYPE_CASTS(RemoteBridgeFrameOwner, FrameOwner, owner, !owner->isLocal(),
!owner.isLocal()); | |
57 | |
58 } // namespace blink | |
59 | |
60 #endif // RemoteBridgeFrameOwner_h | |
OLD | NEW |