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 MediaValues_h | 5 #ifndef MediaValues_h |
6 #define MediaValues_h | 6 #define MediaValues_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "public/platform/PointerProperties.h" | 10 #include "public/platform/PointerProperties.h" |
11 #include "public/platform/WebDisplayMode.h" | 11 #include "public/platform/WebDisplayMode.h" |
12 #include "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
13 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class Document; | 17 class Document; |
18 class CSSPrimitiveValue; | 18 class CSSPrimitiveValue; |
19 class LocalFrame; | 19 class LocalFrame; |
20 | 20 |
21 class CORE_EXPORT MediaValues : public GarbageCollectedFinalized<MediaValues> { | 21 class CORE_EXPORT MediaValues : public GarbageCollectedFinalized<MediaValues> { |
22 public: | 22 public: |
23 | 23 |
24 virtual ~MediaValues() { } | 24 virtual ~MediaValues() { } |
25 DEFINE_INLINE_VIRTUAL_TRACE() { } | 25 DEFINE_INLINE_VIRTUAL_TRACE() { } |
26 | 26 |
27 static RawPtr<MediaValues> createDynamicIfFrameExists(LocalFrame*); | 27 static MediaValues* createDynamicIfFrameExists(LocalFrame*); |
28 virtual RawPtr<MediaValues> copy() const = 0; | 28 virtual MediaValues* copy() const = 0; |
29 | 29 |
30 static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, uns
igned defaultFontSize, double viewportWidth, double viewportHeight, double& resu
lt); | 30 static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, uns
igned defaultFontSize, double viewportWidth, double viewportHeight, double& resu
lt); |
31 template<typename T> | 31 template<typename T> |
32 static bool computeLength(double value, CSSPrimitiveValue::UnitType type, un
signed defaultFontSize, double viewportWidth, double viewportHeight, T& result) | 32 static bool computeLength(double value, CSSPrimitiveValue::UnitType type, un
signed defaultFontSize, double viewportWidth, double viewportHeight, T& result) |
33 { | 33 { |
34 double tempResult; | 34 double tempResult; |
35 if (!computeLengthImpl(value, type, defaultFontSize, viewportWidth, view
portHeight, tempResult)) | 35 if (!computeLengthImpl(value, type, defaultFontSize, viewportWidth, view
portHeight, tempResult)) |
36 return false; | 36 return false; |
37 result = clampTo<T>(tempResult); | 37 result = clampTo<T>(tempResult); |
38 return true; | 38 return true; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 static int calculateAvailablePointerTypes(LocalFrame*); | 77 static int calculateAvailablePointerTypes(LocalFrame*); |
78 static HoverType calculatePrimaryHoverType(LocalFrame*); | 78 static HoverType calculatePrimaryHoverType(LocalFrame*); |
79 static int calculateAvailableHoverTypes(LocalFrame*); | 79 static int calculateAvailableHoverTypes(LocalFrame*); |
80 static LocalFrame* frameFrom(Document&); | 80 static LocalFrame* frameFrom(Document&); |
81 | 81 |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif // MediaValues_h | 86 #endif // MediaValues_h |
OLD | NEW |