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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutPart.h

Issue 2764313002: Move plugins to be stored in HTMLPlugInElement. (Closed)
Patch Set: Fix PartPainter CHECK to !plugin rather than must be frame. Created 3 years, 8 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
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 * 20 *
21 */ 21 */
22 22
23 #ifndef LayoutPart_h 23 #ifndef LayoutPart_h
24 #define LayoutPart_h 24 #define LayoutPart_h
25 25
26 #include "core/CoreExport.h" 26 #include "core/CoreExport.h"
27 #include "core/layout/LayoutReplaced.h" 27 #include "core/layout/LayoutReplaced.h"
28 #include "core/plugins/PluginView.h"
28 #include "platform/FrameViewBase.h" 29 #include "platform/FrameViewBase.h"
29 30
30 namespace blink { 31 namespace blink {
31 32
32 // LayoutObject for frames via LayoutFrame and LayoutIFrame, and plugins via 33 // LayoutObject for frames via LayoutFrame and LayoutIFrame, and plugins via
33 // LayoutEmbeddedObject. 34 // LayoutEmbeddedObject.
34 class CORE_EXPORT LayoutPart : public LayoutReplaced { 35 class CORE_EXPORT LayoutPart : public LayoutReplaced {
35 public: 36 public:
36 explicit LayoutPart(Element*); 37 explicit LayoutPart(Element*);
37 ~LayoutPart() override; 38 ~LayoutPart() override;
38 39
39 bool requiresAcceleratedCompositing() const; 40 bool requiresAcceleratedCompositing() const;
40 41
41 bool needsPreferredWidthsRecalculation() const final; 42 bool needsPreferredWidthsRecalculation() const final;
42 43
43 bool nodeAtPoint(HitTestResult&, 44 bool nodeAtPoint(HitTestResult&,
44 const HitTestLocation& locationInContainer, 45 const HitTestLocation& locationInContainer,
45 const LayoutPoint& accumulatedOffset, 46 const LayoutPoint& accumulatedOffset,
46 HitTestAction) override; 47 HitTestAction) override;
47 48
48 void ref() { ++m_refCount; } 49 void ref() { ++m_refCount; }
49 void deref(); 50 void deref();
50 51
51 FrameViewBase* frameViewBase() const; 52 FrameViewBase* frameViewBase() const;
53 PluginView* plugin() const;
52 54
53 LayoutRect replacedContentRect() const final; 55 LayoutRect replacedContentRect() const final;
54 56
55 void updateOnWidgetChange(); 57 void updateOnWidgetChange();
56 void updateGeometry(); 58 void updateGeometry();
57 59
58 bool isLayoutPart() const final { return true; } 60 bool isLayoutPart() const final { return true; }
59 virtual void paintContents(const PaintInfo&, const LayoutPoint&) const; 61 virtual void paintContents(const PaintInfo&, const LayoutPoint&) const;
60 62
61 bool isThrottledFrameView() const; 63 bool isThrottledFrameView() const;
62 64
63 protected: 65 protected:
64 PaintLayerType layerTypeRequired() const override; 66 PaintLayerType layerTypeRequired() const override;
65 67
66 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) final; 68 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) final;
67 void layout() override; 69 void layout() override;
68 void paint(const PaintInfo&, const LayoutPoint&) const override; 70 void paint(const PaintInfo&, const LayoutPoint&) const override;
69 CursorDirective getCursor(const LayoutPoint&, Cursor&) const final; 71 CursorDirective getCursor(const LayoutPoint&, Cursor&) const final;
70 72
71 // Overridden to invalidate the child frame if any. 73 // Overridden to invalidate the child frame if any.
72 void invalidatePaintOfSubtreesIfNeeded( 74 void invalidatePaintOfSubtreesIfNeeded(
73 const PaintInvalidationState&) override; 75 const PaintInvalidationState&) override;
74 76
75 private: 77 private:
76 void updateGeometryInternal(); 78 void updateGeometryInternal(FrameViewBase&);
77 CompositingReasons additionalCompositingReasons() const override; 79 CompositingReasons additionalCompositingReasons() const override;
78 80
79 void willBeDestroyed() final; 81 void willBeDestroyed() final;
80 void destroy() final; 82 void destroy() final;
81 83
82 bool nodeAtPointOverFrameViewBase(HitTestResult&, 84 bool nodeAtPointOverFrameViewBase(HitTestResult&,
83 const HitTestLocation& locationInContainer, 85 const HitTestLocation& locationInContainer,
84 const LayoutPoint& accumulatedOffset, 86 const LayoutPoint& accumulatedOffset,
85 HitTestAction); 87 HitTestAction);
86 88
87 int m_refCount; 89 int m_refCount;
88 }; 90 };
89 91
90 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutPart, isLayoutPart()); 92 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutPart, isLayoutPart());
91 93
92 } // namespace blink 94 } // namespace blink
93 95
94 #endif // LayoutPart_h 96 #endif // LayoutPart_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698