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/PtrUtil.h" | 40 #include "wtf/PassOwnPtr.h" |
41 #include <memory> | |
42 | 41 |
43 namespace blink { | 42 namespace blink { |
44 | 43 |
45 // This class harmonizes the viewport (particularly page scale) constraints from | 44 // This class harmonizes the viewport (particularly page scale) constraints from |
46 // the meta viewport tag and other sources. | 45 // the meta viewport tag and other sources. |
47 class CORE_EXPORT PageScaleConstraintsSet { | 46 class CORE_EXPORT PageScaleConstraintsSet { |
48 USING_FAST_MALLOC(PageScaleConstraintsSet); | 47 USING_FAST_MALLOC(PageScaleConstraintsSet); |
49 public: | 48 public: |
50 static std::unique_ptr<PageScaleConstraintsSet> create() | 49 static PassOwnPtr<PageScaleConstraintsSet> create() |
51 { | 50 { |
52 return wrapUnique(new PageScaleConstraintsSet); | 51 return adoptPtr(new PageScaleConstraintsSet); |
53 } | 52 } |
54 | 53 |
55 void setDefaultConstraints(const PageScaleConstraints&); | 54 void setDefaultConstraints(const PageScaleConstraints&); |
56 const PageScaleConstraints& defaultConstraints() const; | 55 const PageScaleConstraints& defaultConstraints() const; |
57 | 56 |
58 // Settings defined in the website's viewport tag, if viewport tag support | 57 // Settings defined in the website's viewport tag, if viewport tag support |
59 // is enabled. | 58 // is enabled. |
60 const PageScaleConstraints& pageDefinedConstraints() const { return m_pageDe
finedConstraints; } | 59 const PageScaleConstraints& pageDefinedConstraints() const { return m_pageDe
finedConstraints; } |
61 void updatePageDefinedConstraints(const ViewportDescription&, Length legacyF
allbackWidth); | 60 void updatePageDefinedConstraints(const ViewportDescription&, Length legacyF
allbackWidth); |
62 void adjustForAndroidWebViewQuirks(const ViewportDescription&, int layoutFal
lbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideView
portQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserS
calableQuirkEnabled); | 61 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... |
104 int m_lastContentsWidth; | 103 int m_lastContentsWidth; |
105 IntSize m_icbSize; | 104 IntSize m_icbSize; |
106 | 105 |
107 bool m_needsReset; | 106 bool m_needsReset; |
108 bool m_constraintsDirty; | 107 bool m_constraintsDirty; |
109 }; | 108 }; |
110 | 109 |
111 } // namespace blink | 110 } // namespace blink |
112 | 111 |
113 #endif // PageScaleConstraintsSet_h | 112 #endif // PageScaleConstraintsSet_h |
OLD | NEW |