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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2105523002: Don't set shownRatio in main thread top controls on animated state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 1824
1825 if (mainFrameImpl()->frameView()) { 1825 if (mainFrameImpl()->frameView()) {
1826 if (!mainFrameImpl()->frameView()->needsLayout()) 1826 if (!mainFrameImpl()->frameView()->needsLayout())
1827 postLayoutResize(mainFrameImpl()); 1827 postLayoutResize(mainFrameImpl());
1828 } 1828 }
1829 } 1829 }
1830 1830
1831 void WebViewImpl::updateTopControlsState(WebTopControlsState constraint, WebTopC ontrolsState current, bool animate) 1831 void WebViewImpl::updateTopControlsState(WebTopControlsState constraint, WebTopC ontrolsState current, bool animate)
1832 { 1832 {
1833 topControls().updateConstraints(constraint); 1833 topControls().updateConstraints(constraint);
1834
1835 // If the change should be animated, let the impl thread drive the change.
1836 // Otherwise, immediately set the shown ratio so we don't have to wait for
1837 // a commit from the impl thread.
1838 if (!animate) {
1839 if (current == WebTopControlsShown)
1840 topControls().setShownRatio(1.f);
1841 else if (current == WebTopControlsHidden)
1842 topControls().setShownRatio(0.f);
majidvp 2016/06/28 19:52:20 Maybe it is worth it to specifically call out the
bokan 2016/06/28 23:15:33 Done.
1843 }
majidvp 2016/06/28 19:52:20 Why move the clamping logic out of top controls? I
bokan 2016/06/28 23:15:33 Done.
1844
1834 if (m_layerTreeView) 1845 if (m_layerTreeView)
1835 m_layerTreeView->updateTopControlsState(constraint, current, animate); 1846 m_layerTreeView->updateTopControlsState(constraint, current, animate);
1836 } 1847 }
1837 1848
1838 void WebViewImpl::didUpdateTopControls() 1849 void WebViewImpl::didUpdateTopControls()
1839 { 1850 {
1840 if (m_layerTreeView) { 1851 if (m_layerTreeView) {
1841 m_layerTreeView->setTopControlsShownRatio(topControls().shownRatio()); 1852 m_layerTreeView->setTopControlsShownRatio(topControls().shownRatio());
1842 m_layerTreeView->setTopControlsHeight(topControls().height(), topControl s().shrinkViewport()); 1853 m_layerTreeView->setTopControlsHeight(topControls().height(), topControl s().shrinkViewport());
1843 } 1854 }
(...skipping 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after
4521 { 4532 {
4522 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4533 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4523 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4534 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4524 if (!page()) 4535 if (!page())
4525 return 1; 4536 return 1;
4526 4537
4527 return page()->deviceScaleFactor(); 4538 return page()->deviceScaleFactor();
4528 } 4539 }
4529 4540
4530 } // namespace blink 4541 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/TopControls.cpp ('k') | third_party/WebKit/Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698