| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 LayoutPartItem_h | 5 #ifndef LayoutPartItem_h |
| 6 #define LayoutPartItem_h | 6 #define LayoutPartItem_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutPart.h" | 8 #include "core/layout/LayoutPart.h" |
| 9 #include "core/layout/api/LayoutBoxItem.h" | 9 #include "core/layout/api/LayoutBoxItem.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class LayoutPartItem : public LayoutBoxItem { | 13 class LayoutPartItem : public LayoutBoxItem { |
| 14 public: | 14 public: |
| 15 explicit LayoutPartItem(LayoutPart* layoutPart) : LayoutBoxItem(layoutPart) {} | 15 explicit LayoutPartItem(LayoutPart* layoutPart) : LayoutBoxItem(layoutPart) {} |
| 16 | 16 |
| 17 explicit LayoutPartItem(const LayoutItem& item) : LayoutBoxItem(item) { | 17 explicit LayoutPartItem(const LayoutItem& item) : LayoutBoxItem(item) { |
| 18 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isLayoutPart()); | 18 SECURITY_DCHECK(!item || item.isLayoutPart()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 explicit LayoutPartItem(std::nullptr_t) : LayoutBoxItem(nullptr) {} | 21 explicit LayoutPartItem(std::nullptr_t) : LayoutBoxItem(nullptr) {} |
| 22 | 22 |
| 23 LayoutPartItem() {} | 23 LayoutPartItem() {} |
| 24 | 24 |
| 25 void updateOnWidgetChange() { toPart()->updateOnWidgetChange(); } | 25 void updateOnWidgetChange() { toPart()->updateOnWidgetChange(); } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 LayoutPart* toPart() { return toLayoutPart(layoutObject()); } | 28 LayoutPart* toPart() { return toLayoutPart(layoutObject()); } |
| 29 | 29 |
| 30 const LayoutPart* toPart() const { return toLayoutPart(layoutObject()); } | 30 const LayoutPart* toPart() const { return toLayoutPart(layoutObject()); } |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace blink | 33 } // namespace blink |
| 34 | 34 |
| 35 #endif // LayoutPartItem_h | 35 #endif // LayoutPartItem_h |
| OLD | NEW |