| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 ScrollOffset VisualViewport::maximumScrollOffset() const { | 528 ScrollOffset VisualViewport::maximumScrollOffset() const { |
| 529 if (!mainFrame()) | 529 if (!mainFrame()) |
| 530 return ScrollOffset(); | 530 return ScrollOffset(); |
| 531 | 531 |
| 532 // TODO(bokan): We probably shouldn't be storing the bounds in a float. | 532 // TODO(bokan): We probably shouldn't be storing the bounds in a float. |
| 533 // crbug.com/470718. | 533 // crbug.com/470718. |
| 534 FloatSize frameViewSize(contentsSize()); | 534 FloatSize frameViewSize(contentsSize()); |
| 535 | 535 |
| 536 if (m_browserControlsAdjustment) { | 536 if (m_browserControlsAdjustment) { |
| 537 float minScale = | 537 float minScale = frameHost() |
| 538 frameHost().pageScaleConstraintsSet().finalConstraints().minimumScale; | 538 .page() |
| 539 .pageScaleConstraintsSet() |
| 540 .finalConstraints() |
| 541 .minimumScale; |
| 539 frameViewSize.expand(0, m_browserControlsAdjustment / minScale); | 542 frameViewSize.expand(0, m_browserControlsAdjustment / minScale); |
| 540 } | 543 } |
| 541 | 544 |
| 542 frameViewSize.scale(m_scale); | 545 frameViewSize.scale(m_scale); |
| 543 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); | 546 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); |
| 544 | 547 |
| 545 FloatSize viewportSize(m_size); | 548 FloatSize viewportSize(m_size); |
| 546 viewportSize.expand(0, ceilf(m_browserControlsAdjustment)); | 549 viewportSize.expand(0, ceilf(m_browserControlsAdjustment)); |
| 547 | 550 |
| 548 FloatSize maxPosition = frameViewSize - viewportSize; | 551 FloatSize maxPosition = frameViewSize - viewportSize; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 return false; | 782 return false; |
| 780 | 783 |
| 781 if (!mainFrame()->settings()->getViewportEnabled()) | 784 if (!mainFrame()->settings()->getViewportEnabled()) |
| 782 return false; | 785 return false; |
| 783 | 786 |
| 784 // A document is considered adapted to small screen UAs if one of these holds: | 787 // A document is considered adapted to small screen UAs if one of these holds: |
| 785 // 1. The author specified viewport has a constrained width that is equal to | 788 // 1. The author specified viewport has a constrained width that is equal to |
| 786 // the initial viewport width. | 789 // the initial viewport width. |
| 787 // 2. The author has disabled viewport zoom. | 790 // 2. The author has disabled viewport zoom. |
| 788 const PageScaleConstraints& constraints = | 791 const PageScaleConstraints& constraints = |
| 789 frameHost().pageScaleConstraintsSet().pageDefinedConstraints(); | 792 frameHost().page().pageScaleConstraintsSet().pageDefinedConstraints(); |
| 790 | 793 |
| 791 return mainFrame()->view()->layoutSize().width() == m_size.width() || | 794 return mainFrame()->view()->layoutSize().width() == m_size.width() || |
| 792 (constraints.minimumScale == constraints.maximumScale && | 795 (constraints.minimumScale == constraints.maximumScale && |
| 793 constraints.minimumScale != -1); | 796 constraints.minimumScale != -1); |
| 794 } | 797 } |
| 795 | 798 |
| 796 CompositorAnimationHost* VisualViewport::compositorAnimationHost() const { | 799 CompositorAnimationHost* VisualViewport::compositorAnimationHost() const { |
| 797 DCHECK(frameHost().page().mainFrame()->isLocalFrame()); | 800 DCHECK(frameHost().page().mainFrame()->isLocalFrame()); |
| 798 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator(); | 801 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator(); |
| 799 return c ? c->compositorAnimationHost() : nullptr; | 802 return c ? c->compositorAnimationHost() : nullptr; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 } else if (graphicsLayer == m_rootTransformLayer.get()) { | 839 } else if (graphicsLayer == m_rootTransformLayer.get()) { |
| 837 name = "Root Transform Layer"; | 840 name = "Root Transform Layer"; |
| 838 } else { | 841 } else { |
| 839 ASSERT_NOT_REACHED(); | 842 ASSERT_NOT_REACHED(); |
| 840 } | 843 } |
| 841 | 844 |
| 842 return name; | 845 return name; |
| 843 } | 846 } |
| 844 | 847 |
| 845 } // namespace blink | 848 } // namespace blink |
| OLD | NEW |