| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MediaValuesDynamic_h | 5 #ifndef MediaValuesDynamic_h |
| 6 #define MediaValuesDynamic_h | 6 #define MediaValuesDynamic_h |
| 7 | 7 |
| 8 #include "core/css/MediaValues.h" | 8 #include "core/css/MediaValues.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class Document; | 12 class Document; |
| 13 | 13 |
| 14 class MediaValuesDynamic final : public MediaValues { | 14 class MediaValuesDynamic final : public MediaValues { |
| 15 public: | 15 public: |
| 16 static PassRefPtrWillBeRawPtr<MediaValues> create(Document&); | 16 static PassRefPtrWillBeRawPtr<MediaValues> create(Document&); |
| 17 static PassRefPtrWillBeRawPtr<MediaValues> create(LocalFrame*); | 17 static PassRefPtrWillBeRawPtr<MediaValues> create(LocalFrame*); |
| 18 PassRefPtrWillBeRawPtr<MediaValues> copy() const override; | 18 PassRefPtrWillBeRawPtr<MediaValues> copy() const override; |
| 19 bool isSafeToSendToAnotherThread() const override; | 19 bool isSafeToSendToAnotherThread() const override; |
| 20 bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) c
onst override; | 20 bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) c
onst override; |
| 21 bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result
) const override; | 21 bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result
) const override; |
| 22 | 22 |
| 23 int viewportWidth() const override; | 23 double viewportWidth() const override; |
| 24 int viewportHeight() const override; | 24 double viewportHeight() const override; |
| 25 int deviceWidth() const override; | 25 int deviceWidth() const override; |
| 26 int deviceHeight() const override; | 26 int deviceHeight() const override; |
| 27 float devicePixelRatio() const override; | 27 float devicePixelRatio() const override; |
| 28 int colorBitsPerComponent() const override; | 28 int colorBitsPerComponent() const override; |
| 29 int monochromeBitsPerComponent() const override; | 29 int monochromeBitsPerComponent() const override; |
| 30 PointerType primaryPointerType() const override; | 30 PointerType primaryPointerType() const override; |
| 31 int availablePointerTypes() const override; | 31 int availablePointerTypes() const override; |
| 32 HoverType primaryHoverType() const override; | 32 HoverType primaryHoverType() const override; |
| 33 int availableHoverTypes() const override; | 33 int availableHoverTypes() const override; |
| 34 bool threeDEnabled() const override; | 34 bool threeDEnabled() const override; |
| 35 bool strictMode() const override; | 35 bool strictMode() const override; |
| 36 const String mediaType() const override; | 36 const String mediaType() const override; |
| 37 WebDisplayMode displayMode() const override; | 37 WebDisplayMode displayMode() const override; |
| 38 Document* document() const override; | 38 Document* document() const override; |
| 39 bool hasValues() const override; | 39 bool hasValues() const override; |
| 40 | 40 |
| 41 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 MediaValuesDynamic(LocalFrame*); | 44 MediaValuesDynamic(LocalFrame*); |
| 45 | 45 |
| 46 // This raw ptr is safe, as MediaValues would not outlive MediaQueryEvaluato
r, and | 46 // This raw ptr is safe, as MediaValues would not outlive MediaQueryEvaluato
r, and |
| 47 // MediaQueryEvaluator is reset on |Document::detach|. | 47 // MediaQueryEvaluator is reset on |Document::detach|. |
| 48 RawPtrWillBeMember<LocalFrame> m_frame; | 48 RawPtrWillBeMember<LocalFrame> m_frame; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 #endif // MediaValuesDynamic_h | 53 #endif // MediaValuesDynamic_h |
| OLD | NEW |