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
3 // found in the LICENSE file.
5 #ifndef MediaValuesDynamic_h
6 #define MediaValuesDynamic_h
8 #include "core/css/MediaValues.h"
14 class MediaValuesDynamic FINAL : public MediaValues {
16 static PassRefPtr<MediaValues> create(Document&);
17 static PassRefPtr<MediaValues> create(LocalFrame*);
18 virtual PassRefPtr<MediaValues> copy() const OVERRIDE;
19 virtual bool isSafeToSendToAnotherThread() const OVERRIDE;
20 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) const OVERRIDE;
21 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result) const OVERRIDE;
23 virtual int viewportWidth() const OVERRIDE;
24 virtual int viewportHeight() const OVERRIDE;
25 virtual int deviceWidth() const OVERRIDE;
26 virtual int deviceHeight() const OVERRIDE;
27 virtual float devicePixelRatio() const OVERRIDE;
28 virtual int colorBitsPerComponent() const OVERRIDE;
29 virtual int monochromeBitsPerComponent() const OVERRIDE;
30 virtual PointerDeviceType pointer() const OVERRIDE;
31 virtual bool threeDEnabled() const OVERRIDE;
32 virtual bool strictMode() const OVERRIDE;
33 virtual const String mediaType() const OVERRIDE;
34 virtual Document* document() const OVERRIDE;
35 virtual bool hasValues() const OVERRIDE;
38 MediaValuesDynamic(LocalFrame*);
40 // This raw ptr is safe, as MediaValues would not outlive MediaQueryEvaluator, and
41 // MediaQueryEvaluator is reset on |Document::detach|.
42 // FIXME: Oilpan: This raw ptr should be changed to a Member when LocalFrame is migrated to the heap.
48 #endif // MediaValuesDynamic_h