Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Unified Diff: Source/core/page/PageScaleConstraints.h

Issue 14813025: Refactor viewport initialization logic out of WebViewImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix webkit_unit_tests Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/page/PageScaleConstraints.h
diff --git a/Source/core/html/ime/Composition.h b/Source/core/page/PageScaleConstraints.h
similarity index 71%
copy from Source/core/html/ime/Composition.h
copy to Source/core/page/PageScaleConstraints.h
index 9947d2411a77f4fa0a4cd3dc9758d369a8cfaf7b..92688aadd2aa49de59ef2afc8eff53673454dd2f 100644
--- a/Source/core/html/ime/Composition.h
+++ b/Source/core/page/PageScaleConstraints.h
@@ -28,33 +28,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Composition_h
-#define Composition_h
+#ifndef PageScaleConstraints_h
+#define PageScaleConstraints_h
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
+#include "core/platform/graphics/FloatSize.h"
namespace WebCore {
-class Node;
-class Range;
+struct PageScaleConstraints {
+ FloatSize layoutSize;
-class Composition : public RefCounted<Composition> {
-public:
- static PassRefPtr<Composition> create(Node*, Range*);
- ~Composition();
+ float initialScale;
+ float minimumScale;
+ float maximumScale;
- Node* text() const { return m_text.get(); }
- Range* caret() const { return m_caret.get(); }
+ PageScaleConstraints();
+ PageScaleConstraints(float initial, float minimum, float maximum);
-private:
- Composition(Node*, Range*);
+ void overrideWith(const PageScaleConstraints& other);
+ float clampToConstraints(float pageScaleFactor) const;
+ void clampAll();
+ void fitToContentsWidth(float contentsWidth, int viewWidthNotIncludingScrollbars);
- RefPtr<Node> m_text;
- RefPtr<Range> m_caret;
+ bool operator==(const PageScaleConstraints& other) const;
};
} // namespace WebCore
-#endif // Composition_h
+#endif // PageScaleConstraints_h

Powered by Google App Engine
This is Rietveld 408576698