OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef PageScaleConstraintsSet_h | 31 #ifndef PageScaleConstraintsSet_h |
32 #define PageScaleConstraintsSet_h | 32 #define PageScaleConstraintsSet_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/dom/ViewportDescription.h" | 35 #include "core/dom/ViewportDescription.h" |
36 #include "core/frame/PageScaleConstraints.h" | 36 #include "core/frame/PageScaleConstraints.h" |
37 #include "platform/Length.h" | 37 #include "platform/Length.h" |
38 #include "platform/geometry/IntSize.h" | 38 #include "platform/geometry/IntSize.h" |
39 #include "wtf/Allocator.h" | 39 #include "wtf/Allocator.h" |
40 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PtrUtil.h" |
| 41 #include <memory> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
44 // This class harmonizes the viewport (particularly page scale) constraints from | 45 // This class harmonizes the viewport (particularly page scale) constraints from |
45 // the meta viewport tag and other sources. | 46 // the meta viewport tag and other sources. |
46 class CORE_EXPORT PageScaleConstraintsSet { | 47 class CORE_EXPORT PageScaleConstraintsSet { |
47 USING_FAST_MALLOC(PageScaleConstraintsSet); | 48 USING_FAST_MALLOC(PageScaleConstraintsSet); |
48 public: | 49 public: |
49 static PassOwnPtr<PageScaleConstraintsSet> create() | 50 static std::unique_ptr<PageScaleConstraintsSet> create() |
50 { | 51 { |
51 return adoptPtr(new PageScaleConstraintsSet); | 52 return wrapUnique(new PageScaleConstraintsSet); |
52 } | 53 } |
53 | 54 |
54 void setDefaultConstraints(const PageScaleConstraints&); | 55 void setDefaultConstraints(const PageScaleConstraints&); |
55 const PageScaleConstraints& defaultConstraints() const; | 56 const PageScaleConstraints& defaultConstraints() const; |
56 | 57 |
57 // Settings defined in the website's viewport tag, if viewport tag support | 58 // Settings defined in the website's viewport tag, if viewport tag support |
58 // is enabled. | 59 // is enabled. |
59 const PageScaleConstraints& pageDefinedConstraints() const { return m_pageDe
finedConstraints; } | 60 const PageScaleConstraints& pageDefinedConstraints() const { return m_pageDe
finedConstraints; } |
60 void updatePageDefinedConstraints(const ViewportDescription&, Length legacyF
allbackWidth); | 61 void updatePageDefinedConstraints(const ViewportDescription&, Length legacyF
allbackWidth); |
61 void adjustForAndroidWebViewQuirks(const ViewportDescription&, int layoutFal
lbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideView
portQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserS
calableQuirkEnabled); | 62 void adjustForAndroidWebViewQuirks(const ViewportDescription&, int layoutFal
lbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideView
portQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserS
calableQuirkEnabled); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 int m_lastContentsWidth; | 104 int m_lastContentsWidth; |
104 IntSize m_icbSize; | 105 IntSize m_icbSize; |
105 | 106 |
106 bool m_needsReset; | 107 bool m_needsReset; |
107 bool m_constraintsDirty; | 108 bool m_constraintsDirty; |
108 }; | 109 }; |
109 | 110 |
110 } // namespace blink | 111 } // namespace blink |
111 | 112 |
112 #endif // PageScaleConstraintsSet_h | 113 #endif // PageScaleConstraintsSet_h |
OLD | NEW |