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 } | 18 } |
19 | 19 |
20 explicit LayoutEmbeddedItem(const LayoutItem& item) | 20 explicit LayoutEmbeddedItem(const LayoutItem& item) |
21 : LayoutPartItem(item) | 21 : LayoutPartItem(item) |
22 { | 22 { |
23 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isEmbeddedObject()); | 23 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isEmbeddedObject()); |
24 } | 24 } |
25 | 25 |
26 explicit LayoutEmbeddedItem(std::nullptr_t) : LayoutPartItem(nullptr) { } | 26 explicit LayoutEmbeddedItem(std::nullptr_t) : LayoutPartItem(nullptr) { } |
27 | 27 |
28 LayoutEmbeddedItem() { } | 28 LayoutEmbeddedItem() { } |
29 | 29 |
30 void setPluginUnavailabilityReason(LayoutEmbeddedObject::PluginUnavailabilit
yReason reason) | 30 void setPluginAvailability(LayoutEmbeddedObject::PluginAvailability availabi
lity) |
31 { | 31 { |
32 toEmbeddedObject()->setPluginUnavailabilityReason(reason); | 32 toEmbeddedObject()->setPluginAvailability(availability); |
33 } | 33 } |
34 | 34 |
35 bool showsUnavailablePluginIndicator() const | 35 bool showsUnavailablePluginIndicator() const |
36 { | 36 { |
37 return toEmbeddedObject()->showsUnavailablePluginIndicator(); | 37 return toEmbeddedObject()->showsUnavailablePluginIndicator(); |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 LayoutEmbeddedObject* toEmbeddedObject() | 41 LayoutEmbeddedObject* toEmbeddedObject() |
42 { | 42 { |
43 return toLayoutEmbeddedObject(layoutObject()); | 43 return toLayoutEmbeddedObject(layoutObject()); |
44 } | 44 } |
45 | 45 |
46 const LayoutEmbeddedObject* toEmbeddedObject() const | 46 const LayoutEmbeddedObject* toEmbeddedObject() const |
47 { | 47 { |
48 return toLayoutEmbeddedObject(layoutObject()); | 48 return toLayoutEmbeddedObject(layoutObject()); |
49 } | 49 } |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // LayoutEmbeddedItem_h | 54 #endif // LayoutEmbeddedItem_h |
OLD | NEW |