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

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

Issue 893683003: Implement top controls show/hide functionality for main thread scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix hiding at the page bottom issue Created 5 years, 10 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "web/ContextMenuClientImpl.h" 53 #include "web/ContextMenuClientImpl.h"
54 #include "web/DragClientImpl.h" 54 #include "web/DragClientImpl.h"
55 #include "web/EditorClientImpl.h" 55 #include "web/EditorClientImpl.h"
56 #include "web/InspectorClientImpl.h" 56 #include "web/InspectorClientImpl.h"
57 #include "web/MediaKeysClientImpl.h" 57 #include "web/MediaKeysClientImpl.h"
58 #include "web/PageOverlayList.h" 58 #include "web/PageOverlayList.h"
59 #include "web/PageScaleConstraintsSet.h" 59 #include "web/PageScaleConstraintsSet.h"
60 #include "web/PageWidgetDelegate.h" 60 #include "web/PageWidgetDelegate.h"
61 #include "web/SpellCheckerClientImpl.h" 61 #include "web/SpellCheckerClientImpl.h"
62 #include "web/StorageClientImpl.h" 62 #include "web/StorageClientImpl.h"
63 #include "web/TopControls.h"
63 #include "wtf/OwnPtr.h" 64 #include "wtf/OwnPtr.h"
64 #include "wtf/RefCounted.h" 65 #include "wtf/RefCounted.h"
65 #include "wtf/Vector.h" 66 #include "wtf/Vector.h"
66 67
67 namespace blink { 68 namespace blink {
68 69
69 class DataObject; 70 class DataObject;
70 class Frame; 71 class Frame;
71 class FullscreenController; 72 class FullscreenController;
72 class InputMethodContext; 73 class InputMethodContext;
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // Exposed for tests. 511 // Exposed for tests.
511 WebVector<WebCompositionUnderline> compositionUnderlines() const; 512 WebVector<WebCompositionUnderline> compositionUnderlines() const;
512 513
513 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } 514 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; }
514 515
515 bool pinchVirtualViewportEnabled() const; 516 bool pinchVirtualViewportEnabled() const;
516 517
517 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match esHeuristicsForGpuRasterization; } 518 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match esHeuristicsForGpuRasterization; }
518 519
519 virtual void setTopControlsHeight(float height, bool topControlsShrinkLayout Size) override; 520 virtual void setTopControlsHeight(float height, bool topControlsShrinkLayout Size) override;
521 virtual void updateTopControlsState(WebTopControlsState constraint, WebTopCo ntrolsState current, bool animate) override;
522
523 // Exposed for tests.
524 TopControls* topControls() { return m_topControls.get(); }
525 // Called anytime top controls layout height or content offset have changed.
526 void didUpdateTopControls();
527 // Called by top controls manager to determine if top controls should scroll .
528 bool shouldTopControlsConsumeScroll(float scrollDeltaY);
520 529
521 virtual void forceNextWebGLContextCreationToFail() override; 530 virtual void forceNextWebGLContextCreationToFail() override;
522 531
523 IntSize mainFrameSize(); 532 IntSize mainFrameSize();
524 533
525 private: 534 private:
526 void didUpdateTopControls();
527 void setTopControlsShownRatio(float); 535 void setTopControlsShownRatio(float);
528
529 // TODO(bokan): Remains for legacy pinch. Remove once it's gone. Made privat e to 536 // TODO(bokan): Remains for legacy pinch. Remove once it's gone. Made privat e to
530 // prevent external usage 537 // prevent external usage
531 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) o verride; 538 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) o verride;
532 void setPageScaleFactorAndLocation(float, const FloatPoint&); 539 void setPageScaleFactorAndLocation(float, const FloatPoint&);
533 540
534 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& pinchViewportOrigin); 541 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& pinchViewportOrigin);
535 542
536 IntRect visibleRectInDocument() const; 543 IntRect visibleRectInDocument() const;
537 544
538 float legibleScale() const; 545 float legibleScale() const;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 bool m_showPaintRects; 757 bool m_showPaintRects;
751 bool m_showDebugBorders; 758 bool m_showDebugBorders;
752 bool m_continuousPaintingEnabled; 759 bool m_continuousPaintingEnabled;
753 bool m_showScrollBottleneckRects; 760 bool m_showScrollBottleneckRects;
754 WebColor m_baseBackgroundColor; 761 WebColor m_baseBackgroundColor;
755 WebColor m_backgroundColorOverride; 762 WebColor m_backgroundColorOverride;
756 float m_zoomFactorOverride; 763 float m_zoomFactorOverride;
757 764
758 bool m_userGestureObserved; 765 bool m_userGestureObserved;
759 766
760 // The top controls shown amount (normalized from 0 to 1) since the last 767 OwnPtr<TopControls> m_topControls;
aelias_OOO_until_Jul13 2015/02/13 02:03:17 The lifetime is identical to WebViewImpl, so let's
majidvp 2015/02/18 21:03:57 Done. Moved it inside FrameHost and made it a regu
761 // compositor commit.
762 float m_topControlsShownRatio;
763
764 float m_topControlsHeight;
765 // If this is true, then the embedder shrunk the WebView size by the top
766 // controls height.
767 bool m_topControlsShrinkLayoutSize;
768 }; 768 };
769 769
770 DEFINE_TYPE_CASTS(WebViewImpl, WebWidget, widget, widget->isWebView(), widget.is WebView()); 770 DEFINE_TYPE_CASTS(WebViewImpl, WebWidget, widget, widget->isWebView(), widget.is WebView());
771 // We have no ways to check if the specified WebView is an instance of 771 // We have no ways to check if the specified WebView is an instance of
772 // WebViewImpl because WebViewImpl is the only implementation of WebView. 772 // WebViewImpl because WebViewImpl is the only implementation of WebView.
773 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 773 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
774 774
775 } // namespace blink 775 } // namespace blink
776 776
777 #endif 777 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698