| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef FrameOwner_h | 5 #ifndef FrameOwner_h | 
| 6 #define FrameOwner_h | 6 #define FrameOwner_h | 
| 7 | 7 | 
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" | 
| 9 #include "core/dom/SandboxFlags.h" | 9 #include "core/dom/SandboxFlags.h" | 
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" | 
| 11 #include "platform/scroll/ScrollTypes.h" | 11 #include "platform/scroll/ScrollTypes.h" | 
|  | 12 #include "public/platform/WebVector.h" | 
|  | 13 #include "public/platform/modules/permissions/WebPermissionType.h" | 
| 12 | 14 | 
| 13 namespace blink { | 15 namespace blink { | 
| 14 | 16 | 
| 15 class Frame; | 17 class Frame; | 
| 16 | 18 | 
| 17 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally | 19 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally | 
| 18 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can | 20 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can | 
| 19 // be kept (e.g., Frame::m_owner.) | 21 // be kept (e.g., Frame::m_owner.) | 
| 20 class CORE_EXPORT FrameOwner : public GarbageCollectedMixin { | 22 class CORE_EXPORT FrameOwner : public GarbageCollectedMixin { | 
| 21 public: | 23 public: | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 32     virtual void dispatchLoad() = 0; | 34     virtual void dispatchLoad() = 0; | 
| 33 | 35 | 
| 34     // On load failure, a frame can ask its owner to render fallback content | 36     // On load failure, a frame can ask its owner to render fallback content | 
| 35     // which replaces the frame contents. | 37     // which replaces the frame contents. | 
| 36     virtual void renderFallbackContent() = 0; | 38     virtual void renderFallbackContent() = 0; | 
| 37 | 39 | 
| 38     virtual ScrollbarMode scrollingMode() const = 0; | 40     virtual ScrollbarMode scrollingMode() const = 0; | 
| 39     virtual int marginWidth() const = 0; | 41     virtual int marginWidth() const = 0; | 
| 40     virtual int marginHeight() const = 0; | 42     virtual int marginHeight() const = 0; | 
| 41     virtual bool allowFullscreen() const = 0; | 43     virtual bool allowFullscreen() const = 0; | 
|  | 44     virtual const WebVector<WebPermissionType>& delegatedPermissions() const = 0
    ; | 
| 42 }; | 45 }; | 
| 43 | 46 | 
| 44 class CORE_EXPORT DummyFrameOwner : public GarbageCollectedFinalized<DummyFrameO
    wner>, public FrameOwner { | 47 class CORE_EXPORT DummyFrameOwner : public GarbageCollectedFinalized<DummyFrameO
    wner>, public FrameOwner { | 
| 45     USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); | 48     USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); | 
| 46 public: | 49 public: | 
| 47     static DummyFrameOwner* create() | 50     static DummyFrameOwner* create() | 
| 48     { | 51     { | 
| 49         return new DummyFrameOwner; | 52         return new DummyFrameOwner; | 
| 50     } | 53     } | 
| 51 | 54 | 
| 52     DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } | 55     DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } | 
| 53 | 56 | 
| 54     // FrameOwner overrides: | 57     // FrameOwner overrides: | 
| 55     void setContentFrame(Frame&) override { } | 58     void setContentFrame(Frame&) override { } | 
| 56     void clearContentFrame() override { } | 59     void clearContentFrame() override { } | 
| 57     SandboxFlags getSandboxFlags() const override { return SandboxNone; } | 60     SandboxFlags getSandboxFlags() const override { return SandboxNone; } | 
| 58     void dispatchLoad() override { } | 61     void dispatchLoad() override { } | 
| 59     void renderFallbackContent() override { } | 62     void renderFallbackContent() override { } | 
| 60     ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } | 63     ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } | 
| 61     int marginWidth() const override { return -1; } | 64     int marginWidth() const override { return -1; } | 
| 62     int marginHeight() const override { return -1; } | 65     int marginHeight() const override { return -1; } | 
| 63     bool allowFullscreen() const override { return false; } | 66     bool allowFullscreen() const override { return false; } | 
|  | 67     const WebVector<WebPermissionType>& delegatedPermissions() const override | 
|  | 68     { | 
|  | 69         DEFINE_STATIC_LOCAL(WebVector<WebPermissionType>, permissions, ()); | 
|  | 70         return permissions; | 
|  | 71     } | 
| 64 | 72 | 
| 65 private: | 73 private: | 
| 66     // Intentionally private to prevent redundant checks when the type is | 74     // Intentionally private to prevent redundant checks when the type is | 
| 67     // already DummyFrameOwner. | 75     // already DummyFrameOwner. | 
| 68     bool isLocal() const override { return false; } | 76     bool isLocal() const override { return false; } | 
| 69     bool isRemote() const override { return false; } | 77     bool isRemote() const override { return false; } | 
| 70 }; | 78 }; | 
| 71 | 79 | 
| 72 } // namespace blink | 80 } // namespace blink | 
| 73 | 81 | 
| 74 #endif // FrameOwner_h | 82 #endif // FrameOwner_h | 
| OLD | NEW | 
|---|