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

Side by Side Diff: Source/web/WebViewImpl.h

Issue 225303014: [Pinch-to-zoom] Moved scale factor into PinchViewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 virtual void zoomToFindInPageRect(const WebRect&) OVERRIDE; 199 virtual void zoomToFindInPageRect(const WebRect&) OVERRIDE;
200 virtual void advanceFocus(bool reverse) OVERRIDE; 200 virtual void advanceFocus(bool reverse) OVERRIDE;
201 virtual double zoomLevel() OVERRIDE; 201 virtual double zoomLevel() OVERRIDE;
202 virtual double setZoomLevel(double) OVERRIDE; 202 virtual double setZoomLevel(double) OVERRIDE;
203 virtual void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLe vel) OVERRIDE; 203 virtual void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLe vel) OVERRIDE;
204 virtual float textZoomFactor() OVERRIDE; 204 virtual float textZoomFactor() OVERRIDE;
205 virtual float setTextZoomFactor(float) OVERRIDE; 205 virtual float setTextZoomFactor(float) OVERRIDE;
206 virtual void setInitialPageScaleOverride(float) OVERRIDE; 206 virtual void setInitialPageScaleOverride(float) OVERRIDE;
207 virtual bool zoomToMultipleTargetsRect(const WebRect&) OVERRIDE; 207 virtual bool zoomToMultipleTargetsRect(const WebRect&) OVERRIDE;
208 virtual float pageScaleFactor() const OVERRIDE; 208 virtual float pageScaleFactor() const OVERRIDE;
209 virtual void setPageScaleFactorPreservingScrollOffset(float) OVERRIDE; 209 // TODO(bokan): Remains for legacy pinch. Remove once it's gone.
210 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) O VERRIDE; 210 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) O VERRIDE;
211 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) OVERRIDE; 211 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) OVERRIDE;
212 virtual void setMainFrameScrollOffset(const WebPoint&) OVERRIDE;
213 virtual void setPinchViewportScaleFactor(float) OVERRIDE;
214 virtual float pinchViewportScaleFactor() const OVERRIDE;
215 virtual void setPinchViewportOffset(const WebFloatPoint&) OVERRIDE;
216 virtual WebFloatPoint pinchViewportOffset() const OVERRIDE;
212 virtual float minimumPageScaleFactor() const OVERRIDE; 217 virtual float minimumPageScaleFactor() const OVERRIDE;
213 virtual float maximumPageScaleFactor() const OVERRIDE; 218 virtual float maximumPageScaleFactor() const OVERRIDE;
214 virtual void saveScrollAndScaleState() OVERRIDE; 219 virtual void saveScrollAndScaleState() OVERRIDE;
215 virtual void restoreScrollAndScaleState() OVERRIDE; 220 virtual void restoreScrollAndScaleState() OVERRIDE;
216 virtual void resetScrollAndScaleState() OVERRIDE; 221 virtual void resetScrollAndScaleState() OVERRIDE;
217 virtual void setIgnoreViewportTagScaleLimits(bool) OVERRIDE; 222 virtual void setIgnoreViewportTagScaleLimits(bool) OVERRIDE;
218 virtual WebSize contentsPreferredMinimumSize() OVERRIDE; 223 virtual WebSize contentsPreferredMinimumSize() OVERRIDE;
219 224
220 virtual float deviceScaleFactor() const OVERRIDE; 225 virtual float deviceScaleFactor() const OVERRIDE;
221 virtual void setDeviceScaleFactor(float) OVERRIDE; 226 virtual void setDeviceScaleFactor(float) OVERRIDE;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); 517 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping);
513 518
514 WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float scale); 519 WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float scale);
515 520
516 // Exposed for tests. 521 // Exposed for tests.
517 WebVector<WebCompositionUnderline> compositionUnderlines() const; 522 WebVector<WebCompositionUnderline> compositionUnderlines() const;
518 523
519 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } 524 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; }
520 525
521 private: 526 private:
527 bool pinchVirtualViewportEnabled() const;
528
522 float legibleScale() const; 529 float legibleScale() const;
523 void refreshPageScaleFactorAfterLayout(); 530 void refreshPageScaleFactorAfterLayout();
524 void resumeTreeViewCommits(); 531 void resumeTreeViewCommits();
525 void setUserAgentPageScaleConstraints(WebCore::PageScaleConstraints newConst raints); 532 void setUserAgentPageScaleConstraints(WebCore::PageScaleConstraints newConst raints);
526 float clampPageScaleFactorToLimits(float) const; 533 float clampPageScaleFactorToLimits(float) const;
527 WebCore::IntSize contentsSize() const; 534 WebCore::IntSize contentsSize() const;
528 535
529 void resetSavedScrollAndScaleState(); 536 void resetSavedScrollAndScaleState();
530 537
531 void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition, bool programmaticScroll); 538 void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition, bool programmaticScroll);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 float m_zoomFactorOverride; 764 float m_zoomFactorOverride;
758 }; 765 };
759 766
760 // We have no ways to check if the specified WebView is an instance of 767 // We have no ways to check if the specified WebView is an instance of
761 // WebViewImpl because WebViewImpl is the only implementation of WebView. 768 // WebViewImpl because WebViewImpl is the only implementation of WebView.
762 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 769 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
763 770
764 } // namespace blink 771 } // namespace blink
765 772
766 #endif 773 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698