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 "core/css/PointerProperties.h" | 10 #include "core/css/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 RefCounted<MediaValues> { | 21 class CORE_EXPORT MediaValues : public RefCountedWillBeGarbageCollectedFinalized
<MediaValues> { |
22 public: | 22 public: |
23 | 23 |
24 virtual ~MediaValues() { } | 24 virtual ~MediaValues() { } |
| 25 DEFINE_INLINE_VIRTUAL_TRACE() { } |
25 | 26 |
26 static PassRefPtr<MediaValues> createDynamicIfFrameExists(LocalFrame*); | 27 static PassRefPtrWillBeRawPtr<MediaValues> createDynamicIfFrameExists(LocalF
rame*); |
27 virtual PassRefPtr<MediaValues> copy() const = 0; | 28 virtual PassRefPtrWillBeRawPtr<MediaValues> copy() const = 0; |
28 virtual bool isSafeToSendToAnotherThread() const = 0; | 29 virtual bool isSafeToSendToAnotherThread() const = 0; |
29 | 30 |
30 static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, uns
igned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, double&
result); | 31 static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, uns
igned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, double&
result); |
31 template<typename T> | 32 template<typename T> |
32 static bool computeLength(double value, CSSPrimitiveValue::UnitType type, un
signed defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, T& resu
lt) | 33 static bool computeLength(double value, CSSPrimitiveValue::UnitType type, un
signed defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, T& resu
lt) |
33 { | 34 { |
34 double tempResult; | 35 double tempResult; |
35 if (!computeLengthImpl(value, type, defaultFontSize, viewportWidth, view
portHeight, tempResult)) | 36 if (!computeLengthImpl(value, type, defaultFontSize, viewportWidth, view
portHeight, tempResult)) |
36 return false; | 37 return false; |
37 result = clampTo<T>(tempResult); | 38 result = clampTo<T>(tempResult); |
(...skipping 39 matching lines...) Loading... |
77 int calculateAvailablePointerTypes(LocalFrame*) const; | 78 int calculateAvailablePointerTypes(LocalFrame*) const; |
78 HoverType calculatePrimaryHoverType(LocalFrame*) const; | 79 HoverType calculatePrimaryHoverType(LocalFrame*) const; |
79 int calculateAvailableHoverTypes(LocalFrame*) const; | 80 int calculateAvailableHoverTypes(LocalFrame*) const; |
80 static LocalFrame* frameFrom(Document&); | 81 static LocalFrame* frameFrom(Document&); |
81 | 82 |
82 }; | 83 }; |
83 | 84 |
84 } // namespace | 85 } // namespace |
85 | 86 |
86 #endif // MediaValues_h | 87 #endif // MediaValues_h |
OLD | NEW |