OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 FrameOrPlugin_h | 5 #ifndef FrameOrPlugin_h |
6 #define FrameOrPlugin_h | 6 #define FrameOrPlugin_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class CullRect; | 13 class CullRect; |
14 class FrameView; | 14 class FrameView; |
15 class GraphicsContext; | 15 class GraphicsContext; |
16 class IntRect; | 16 class IntRect; |
17 | 17 |
18 // FrameOrPlugin is a pure virtual class which is implemented by FrameView, | 18 // FrameOrPlugin is a pure virtual class which is implemented by FrameView, |
19 // RemoteFrameView, and PluginView. | 19 // RemoteFrameView, and PluginView. |
20 class CORE_EXPORT FrameOrPlugin : public GarbageCollectedMixin { | 20 class CORE_EXPORT FrameOrPlugin : public GarbageCollectedMixin { |
21 public: | 21 public: |
22 virtual ~FrameOrPlugin() {} | 22 virtual ~FrameOrPlugin() {} |
23 | 23 |
24 virtual bool IsFrameView() const { return false; } | 24 virtual bool IsFrameView() const { return false; } |
25 virtual bool IsPluginView() const { return false; } | 25 virtual bool IsPluginView() const { return false; } |
26 | 26 |
27 virtual void SetParent(FrameView*) = 0; | 27 virtual void SetParent(FrameView*) = 0; |
28 virtual FrameView* Parent() const = 0; | 28 virtual FrameView* Parent() const = 0; |
| 29 enum FrameOrPluginState { kNotAttached, kAttached, kDeferred, kDisposed }; |
| 30 virtual void SetFrameOrPluginState(FrameOrPluginState) = 0; |
| 31 virtual FrameOrPluginState GetFrameOrPluginState() const = 0; |
29 virtual void SetParentVisible(bool) = 0; | 32 virtual void SetParentVisible(bool) = 0; |
30 virtual void SetFrameRect(const IntRect&) = 0; | 33 virtual void SetFrameRect(const IntRect&) = 0; |
31 virtual void FrameRectsChanged() = 0; | 34 virtual void FrameRectsChanged() = 0; |
32 virtual const IntRect& FrameRect() const = 0; | 35 virtual const IntRect& FrameRect() const = 0; |
33 virtual void Paint(GraphicsContext&, const CullRect&) const = 0; | 36 virtual void Paint(GraphicsContext&, const CullRect&) const = 0; |
34 virtual void Show() = 0; | 37 virtual void Show() = 0; |
35 virtual void Hide() = 0; | 38 virtual void Hide() = 0; |
36 virtual void Dispose() = 0; | 39 virtual void Dispose() = 0; |
37 }; | 40 }; |
38 | 41 |
39 } // namespace blink | 42 } // namespace blink |
40 #endif // FrameOrPlugin_h | 43 #endif // FrameOrPlugin_h |
OLD | NEW |