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

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

Issue 560623002: Adjust maximum scroll bounds on FrameView to account for top controls. (Blink-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 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 | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.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) 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 , m_showFPSCounter(false) 413 , m_showFPSCounter(false)
414 , m_showPaintRects(false) 414 , m_showPaintRects(false)
415 , m_showDebugBorders(false) 415 , m_showDebugBorders(false)
416 , m_continuousPaintingEnabled(false) 416 , m_continuousPaintingEnabled(false)
417 , m_showScrollBottleneckRects(false) 417 , m_showScrollBottleneckRects(false)
418 , m_baseBackgroundColor(Color::white) 418 , m_baseBackgroundColor(Color::white)
419 , m_backgroundColorOverride(Color::transparent) 419 , m_backgroundColorOverride(Color::transparent)
420 , m_zoomFactorOverride(0) 420 , m_zoomFactorOverride(0)
421 , m_userGestureObserved(false) 421 , m_userGestureObserved(false)
422 , m_topControlsContentOffset(0) 422 , m_topControlsContentOffset(0)
423 , m_topControlsLayoutHeight(0)
423 { 424 {
424 Page::PageClients pageClients; 425 Page::PageClients pageClients;
425 pageClients.chromeClient = &m_chromeClientImpl; 426 pageClients.chromeClient = &m_chromeClientImpl;
426 pageClients.contextMenuClient = &m_contextMenuClientImpl; 427 pageClients.contextMenuClient = &m_contextMenuClientImpl;
427 pageClients.editorClient = &m_editorClientImpl; 428 pageClients.editorClient = &m_editorClientImpl;
428 pageClients.dragClient = &m_dragClientImpl; 429 pageClients.dragClient = &m_dragClientImpl;
429 pageClients.inspectorClient = &m_inspectorClientImpl; 430 pageClients.inspectorClient = &m_inspectorClientImpl;
430 pageClients.backForwardClient = &m_backForwardClientImpl; 431 pageClients.backForwardClient = &m_backForwardClientImpl;
431 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; 432 pageClients.spellCheckerClient = &m_spellCheckerClientImpl;
432 pageClients.storageClient = &m_storageClientImpl; 433 pageClients.storageClient = &m_storageClientImpl;
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 if (page()->inspectorController().deviceEmulationEnabled()) { 1679 if (page()->inspectorController().deviceEmulationEnabled()) {
1679 if (Document* document = localFrameRootTemporary()->frame()->document()) 1680 if (Document* document = localFrameRootTemporary()->frame()->document())
1680 document->mediaQueryAffectingValueChanged(); 1681 document->mediaQueryAffectingValueChanged();
1681 } 1682 }
1682 } 1683 }
1683 1684
1684 void WebViewImpl::setTopControlsContentOffset(float offset) 1685 void WebViewImpl::setTopControlsContentOffset(float offset)
1685 { 1686 {
1686 m_topControlsContentOffset = offset; 1687 m_topControlsContentOffset = offset;
1687 m_layerTreeView->setTopControlsContentOffset(offset); 1688 m_layerTreeView->setTopControlsContentOffset(offset);
1689 didUpdateTopControls();
1690 }
1691
1692 void WebViewImpl::setTopControlsLayoutHeight(float height)
1693 {
1694 m_topControlsLayoutHeight = height;
1695 didUpdateTopControls();
1696 }
1697
1698 void WebViewImpl::didUpdateTopControls()
1699 {
1700 FrameView* view = localFrameRootTemporary()->frameView();
1701 if (!view)
1702 return;
1703
1704 // The viewport bounds were adjusted on the compositor by this much due to t op controls. Tell
1705 // the FrameView about it so it can make correct scroll offset clamping deci sions during compositor
1706 // commits.
1707 // FIXME(bokan) Reenable once Chromium side lands.
1708 // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topC ontrolsLayoutHeight;
1709 // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
1688 } 1710 }
1689 1711
1690 void WebViewImpl::resize(const WebSize& newSize) 1712 void WebViewImpl::resize(const WebSize& newSize)
1691 { 1713 {
1692 if (m_shouldAutoResize || m_size == newSize) 1714 if (m_shouldAutoResize || m_size == newSize)
1693 return; 1715 return;
1694 1716
1695 FrameView* view = localFrameRootTemporary()->frameView(); 1717 FrameView* view = localFrameRootTemporary()->frameView();
1696 if (!view) 1718 if (!view)
1697 return; 1719 return;
(...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
4390 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4412 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4391 4413
4392 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4414 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4393 return false; 4415 return false;
4394 4416
4395 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4417 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4396 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4418 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4397 } 4419 }
4398 4420
4399 } // namespace blink 4421 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698