| 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 LayoutEmbeddedItem_h | 5 #ifndef LayoutEmbeddedItem_h |
| 6 #define LayoutEmbeddedItem_h | 6 #define LayoutEmbeddedItem_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutEmbeddedObject.h" | 8 #include "core/layout/LayoutEmbeddedObject.h" |
| 9 #include "core/layout/api/LayoutPartItem.h" | 9 #include "core/layout/api/LayoutPartItem.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class LayoutEmbeddedItem : public LayoutPartItem { | 13 class LayoutEmbeddedItem : public LayoutPartItem { |
| 14 public: | 14 public: |
| 15 explicit LayoutEmbeddedItem(LayoutEmbeddedObject* layoutEmbeddedObject) | 15 explicit LayoutEmbeddedItem(LayoutEmbeddedObject* layoutEmbeddedObject) |
| 16 : LayoutPartItem(layoutEmbeddedObject) {} | 16 : LayoutPartItem(layoutEmbeddedObject) {} |
| 17 | 17 |
| 18 explicit LayoutEmbeddedItem(const LayoutItem& item) : LayoutPartItem(item) { | 18 explicit LayoutEmbeddedItem(const LayoutItem& item) : LayoutPartItem(item) { |
| 19 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isEmbeddedObject()); | 19 SECURITY_DCHECK(!item || item.isEmbeddedObject()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 explicit LayoutEmbeddedItem(std::nullptr_t) : LayoutPartItem(nullptr) {} | 22 explicit LayoutEmbeddedItem(std::nullptr_t) : LayoutPartItem(nullptr) {} |
| 23 | 23 |
| 24 LayoutEmbeddedItem() {} | 24 LayoutEmbeddedItem() {} |
| 25 | 25 |
| 26 void setPluginAvailability( | 26 void setPluginAvailability( |
| 27 LayoutEmbeddedObject::PluginAvailability availability) { | 27 LayoutEmbeddedObject::PluginAvailability availability) { |
| 28 toEmbeddedObject()->setPluginAvailability(availability); | 28 toEmbeddedObject()->setPluginAvailability(availability); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool showsUnavailablePluginIndicator() const { | 31 bool showsUnavailablePluginIndicator() const { |
| 32 return toEmbeddedObject()->showsUnavailablePluginIndicator(); | 32 return toEmbeddedObject()->showsUnavailablePluginIndicator(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 LayoutEmbeddedObject* toEmbeddedObject() { | 36 LayoutEmbeddedObject* toEmbeddedObject() { |
| 37 return toLayoutEmbeddedObject(layoutObject()); | 37 return toLayoutEmbeddedObject(layoutObject()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 const LayoutEmbeddedObject* toEmbeddedObject() const { | 40 const LayoutEmbeddedObject* toEmbeddedObject() const { |
| 41 return toLayoutEmbeddedObject(layoutObject()); | 41 return toLayoutEmbeddedObject(layoutObject()); |
| 42 } | 42 } |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace blink | 45 } // namespace blink |
| 46 | 46 |
| 47 #endif // LayoutEmbeddedItem_h | 47 #endif // LayoutEmbeddedItem_h |
| OLD | NEW |