| OLD | NEW |
| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 , m_showFPSCounter(false) | 407 , m_showFPSCounter(false) |
| 408 , m_showPaintRects(false) | 408 , m_showPaintRects(false) |
| 409 , m_showDebugBorders(false) | 409 , m_showDebugBorders(false) |
| 410 , m_continuousPaintingEnabled(false) | 410 , m_continuousPaintingEnabled(false) |
| 411 , m_showScrollBottleneckRects(false) | 411 , m_showScrollBottleneckRects(false) |
| 412 , m_baseBackgroundColor(Color::white) | 412 , m_baseBackgroundColor(Color::white) |
| 413 , m_backgroundColorOverride(Color::transparent) | 413 , m_backgroundColorOverride(Color::transparent) |
| 414 , m_zoomFactorOverride(0) | 414 , m_zoomFactorOverride(0) |
| 415 , m_userGestureObserved(false) | 415 , m_userGestureObserved(false) |
| 416 , m_topControlsContentOffset(0) | 416 , m_topControlsContentOffset(0) |
| 417 , m_topControlsLayoutHeight(0) |
| 417 { | 418 { |
| 418 Page::PageClients pageClients; | 419 Page::PageClients pageClients; |
| 419 pageClients.chromeClient = &m_chromeClientImpl; | 420 pageClients.chromeClient = &m_chromeClientImpl; |
| 420 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 421 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
| 421 pageClients.editorClient = &m_editorClientImpl; | 422 pageClients.editorClient = &m_editorClientImpl; |
| 422 pageClients.dragClient = &m_dragClientImpl; | 423 pageClients.dragClient = &m_dragClientImpl; |
| 423 pageClients.inspectorClient = &m_inspectorClientImpl; | 424 pageClients.inspectorClient = &m_inspectorClientImpl; |
| 424 pageClients.backForwardClient = &m_backForwardClientImpl; | 425 pageClients.backForwardClient = &m_backForwardClientImpl; |
| 425 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 426 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
| 426 pageClients.storageClient = &m_storageClientImpl; | 427 pageClients.storageClient = &m_storageClientImpl; |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 if (page()->inspectorController().deviceEmulationEnabled()) { | 1660 if (page()->inspectorController().deviceEmulationEnabled()) { |
| 1660 if (Document* document = localFrameRootTemporary()->frame()->document()) | 1661 if (Document* document = localFrameRootTemporary()->frame()->document()) |
| 1661 document->mediaQueryAffectingValueChanged(); | 1662 document->mediaQueryAffectingValueChanged(); |
| 1662 } | 1663 } |
| 1663 } | 1664 } |
| 1664 | 1665 |
| 1665 void WebViewImpl::setTopControlsContentOffset(float offset) | 1666 void WebViewImpl::setTopControlsContentOffset(float offset) |
| 1666 { | 1667 { |
| 1667 m_topControlsContentOffset = offset; | 1668 m_topControlsContentOffset = offset; |
| 1668 m_layerTreeView->setTopControlsContentOffset(offset); | 1669 m_layerTreeView->setTopControlsContentOffset(offset); |
| 1670 didUpdateTopControls(); |
| 1671 } |
| 1672 |
| 1673 void WebViewImpl::setTopControlsLayoutHeight(float height) |
| 1674 { |
| 1675 m_topControlsLayoutHeight = height; |
| 1676 didUpdateTopControls(); |
| 1677 } |
| 1678 |
| 1679 void WebViewImpl::didUpdateTopControls() |
| 1680 { |
| 1681 FrameView* view = localFrameRootTemporary()->frameView(); |
| 1682 if (!view) |
| 1683 return; |
| 1684 |
| 1685 // The viewport bounds were adjusted on the compositor by this much due to t
op controls. Tell |
| 1686 // the FrameView about it so it can make correct scroll offset clamping deci
sions during compositor |
| 1687 // commits. |
| 1688 // FIXME(bokan) Reenable once Chromium side lands. |
| 1689 // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topC
ontrolsLayoutHeight; |
| 1690 // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment); |
| 1669 } | 1691 } |
| 1670 | 1692 |
| 1671 void WebViewImpl::resize(const WebSize& newSize) | 1693 void WebViewImpl::resize(const WebSize& newSize) |
| 1672 { | 1694 { |
| 1673 if (m_shouldAutoResize || m_size == newSize) | 1695 if (m_shouldAutoResize || m_size == newSize) |
| 1674 return; | 1696 return; |
| 1675 | 1697 |
| 1676 FrameView* view = localFrameRootTemporary()->frameView(); | 1698 FrameView* view = localFrameRootTemporary()->frameView(); |
| 1677 if (!view) | 1699 if (!view) |
| 1678 return; | 1700 return; |
| (...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4290 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4312 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4291 | 4313 |
| 4292 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4314 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4293 return false; | 4315 return false; |
| 4294 | 4316 |
| 4295 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4317 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4296 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4318 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4297 } | 4319 } |
| 4298 | 4320 |
| 4299 } // namespace blink | 4321 } // namespace blink |
| OLD | NEW |