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

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

Issue 23461009: Scale to legibleScale if double tap would barely zoom in from zoomed out state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 static bool mapKeyCodeForScroll(int keyCode, 519 static bool mapKeyCodeForScroll(int keyCode,
520 WebCore::ScrollDirection* scrollDirection, 520 WebCore::ScrollDirection* scrollDirection,
521 WebCore::ScrollGranularity* scrollGranularity ); 521 WebCore::ScrollGranularity* scrollGranularity );
522 522
523 // Called by a full frame plugin inside this view to inform it that its 523 // Called by a full frame plugin inside this view to inform it that its
524 // zoom level has been updated. The plugin should only call this function 524 // zoom level has been updated. The plugin should only call this function
525 // if the zoom change was triggered by the browser, it's only needed in case 525 // if the zoom change was triggered by the browser, it's only needed in case
526 // a plugin can update its own zoom, say because of its own UI. 526 // a plugin can update its own zoom, say because of its own UI.
527 void fullFramePluginZoomLevelChanged(double zoomLevel); 527 void fullFramePluginZoomLevelChanged(double zoomLevel);
528 528
529 void computeScaleAndScrollForBlockRect(const WebRect& blockRect, float paddi ng, float& scale, WebPoint& scroll, bool& doubleTapShouldZoomOut); 529 float computeLegibleScale();
aelias_OOO_until_Jul13 2013/08/29 21:34:40 Please make this private and const, and rename to
530 void computeScaleAndScrollForBlockRect(const WebRect& blockRect, float paddi ng, float defaultScaleWhenAlreadyLegible, float& scale, WebPoint& scroll);
530 WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent); 531 WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent);
531 void enableTapHighlight(const WebCore::PlatformGestureEvent& tapEvent); 532 void enableTapHighlight(const WebCore::PlatformGestureEvent& tapEvent);
532 void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float& scale, WebCore::IntPoint& scroll, bool& needAnimation); 533 void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float& scale, WebCore::IntPoint& scroll, bool& needAnimation);
533 534
534 void animateDoubleTapZoom(const WebCore::IntPoint&); 535 void animateDoubleTapZoom(const WebCore::IntPoint&);
535 536
536 void enableFakePageScaleAnimationForTesting(bool); 537 void enableFakePageScaleAnimationForTesting(bool);
537 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; } 538 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; }
538 WebCore::IntPoint fakePageScaleAnimationTargetPositionForTesting() const { r eturn m_fakePageScaleAnimationTargetPosition; } 539 WebCore::IntPoint fakePageScaleAnimationTargetPositionForTesting() const { r eturn m_fakePageScaleAnimationTargetPosition; }
539 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; } 540 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 inline WebViewImpl* toWebViewImpl(WebView* webView) 842 inline WebViewImpl* toWebViewImpl(WebView* webView)
842 { 843 {
843 // We have no ways to check if the specified WebView is an instance of 844 // We have no ways to check if the specified WebView is an instance of
844 // WebViewImpl because WebViewImpl is the only implementation of WebView. 845 // WebViewImpl because WebViewImpl is the only implementation of WebView.
845 return static_cast<WebViewImpl*>(webView); 846 return static_cast<WebViewImpl*>(webView);
846 } 847 }
847 848
848 } // namespace WebKit 849 } // namespace WebKit
849 850
850 #endif 851 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698