| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2016 The Chromium Authors. All rights reserved. | 2 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #ifndef LayoutProgressItem_h | 6 #ifndef LayoutProgressItem_h |
| 7 #define LayoutProgressItem_h | 7 #define LayoutProgressItem_h |
| 8 | 8 |
| 9 #include "core/layout/LayoutProgress.h" | 9 #include "core/layout/LayoutProgress.h" |
| 10 #include "core/layout/api/LayoutBlockItem.h" | 10 #include "core/layout/api/LayoutBlockItem.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class LayoutProgressItem : public LayoutBlockItem { | 14 class LayoutProgressItem : public LayoutBlockItem { |
| 15 public: | 15 public: |
| 16 explicit LayoutProgressItem(LayoutProgress* layoutProgress) | 16 explicit LayoutProgressItem(LayoutProgress* layoutProgress) |
| 17 : LayoutBlockItem(layoutProgress) {} | 17 : LayoutBlockItem(layoutProgress) {} |
| 18 | 18 |
| 19 explicit LayoutProgressItem(const LayoutBlockItem& item) | 19 explicit LayoutProgressItem(const LayoutBlockItem& item) |
| 20 : LayoutBlockItem(item) { | 20 : LayoutBlockItem(item) { |
| 21 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isProgress()); | 21 SECURITY_DCHECK(!item || item.isProgress()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 explicit LayoutProgressItem(std::nullptr_t) : LayoutBlockItem(nullptr) {} | 24 explicit LayoutProgressItem(std::nullptr_t) : LayoutBlockItem(nullptr) {} |
| 25 | 25 |
| 26 LayoutProgressItem() {} | 26 LayoutProgressItem() {} |
| 27 | 27 |
| 28 bool isDeterminate() const { return toProgress()->isDeterminate(); } | 28 bool isDeterminate() const { return toProgress()->isDeterminate(); } |
| 29 | 29 |
| 30 void updateFromElement() { return toProgress()->updateFromElement(); } | 30 void updateFromElement() { return toProgress()->updateFromElement(); } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 LayoutProgress* toProgress() { return toLayoutProgress(layoutObject()); } | 33 LayoutProgress* toProgress() { return toLayoutProgress(layoutObject()); } |
| 34 const LayoutProgress* toProgress() const { | 34 const LayoutProgress* toProgress() const { |
| 35 return toLayoutProgress(layoutObject()); | 35 return toLayoutProgress(layoutObject()); |
| 36 } | 36 } |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace blink | 39 } // namespace blink |
| 40 | 40 |
| 41 #endif // LayoutProgressItem_h | 41 #endif // LayoutProgressItem_h |
| OLD | NEW |