| 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 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 } | 1721 } |
| 1722 | 1722 |
| 1723 void WebViewImpl::enablePopupMouseWheelEventListener() | 1723 void WebViewImpl::enablePopupMouseWheelEventListener() |
| 1724 { | 1724 { |
| 1725 // TODO(kenrb): Popup coordination for out-of-process iframes needs to be | 1725 // TODO(kenrb): Popup coordination for out-of-process iframes needs to be |
| 1726 // added. Because of the early return here a select element | 1726 // added. Because of the early return here a select element |
| 1727 // popup can remain visible even when the element underneath it is | 1727 // popup can remain visible even when the element underneath it is |
| 1728 // scrolled to a new position. This is part of a larger set of issues with | 1728 // scrolled to a new position. This is part of a larger set of issues with |
| 1729 // popups. | 1729 // popups. |
| 1730 // See https://crbug.com/566130 | 1730 // See https://crbug.com/566130 |
| 1731 if (!mainFrameImpl() || !mainFrameImpl()->frame()->isLocalFrame()) | 1731 if (!mainFrameImpl()) |
| 1732 return; | 1732 return; |
| 1733 DCHECK(!m_popupMouseWheelEventListener); | 1733 DCHECK(!m_popupMouseWheelEventListener); |
| 1734 Document* document = mainFrameImpl()->frame()->document(); | 1734 Document* document = mainFrameImpl()->frame()->document(); |
| 1735 DCHECK(document); | 1735 DCHECK(document); |
| 1736 // We register an empty event listener, EmptyEventListener, so that mouse | 1736 // We register an empty event listener, EmptyEventListener, so that mouse |
| 1737 // wheel events get sent to the WebView. | 1737 // wheel events get sent to the WebView. |
| 1738 m_popupMouseWheelEventListener = EmptyEventListener::create(); | 1738 m_popupMouseWheelEventListener = EmptyEventListener::create(); |
| 1739 document->addEventListener(EventTypeNames::mousewheel, m_popupMouseWheelEven
tListener, false); | 1739 document->addEventListener(EventTypeNames::mousewheel, m_popupMouseWheelEven
tListener, false); |
| 1740 } | 1740 } |
| 1741 | 1741 |
| 1742 void WebViewImpl::disablePopupMouseWheelEventListener() | 1742 void WebViewImpl::disablePopupMouseWheelEventListener() |
| 1743 { | 1743 { |
| 1744 // TODO(kenrb): Concerns the same as in enablePopupMouseWheelEventListener. | 1744 // TODO(kenrb): Concerns the same as in enablePopupMouseWheelEventListener. |
| 1745 // See https://crbug.com/566130 | 1745 // See https://crbug.com/566130 |
| 1746 if (!mainFrameImpl() || !mainFrameImpl()->frame()->isLocalFrame()) | 1746 if (!mainFrameImpl()) |
| 1747 return; | 1747 return; |
| 1748 DCHECK(m_popupMouseWheelEventListener); | 1748 DCHECK(m_popupMouseWheelEventListener); |
| 1749 Document* document = mainFrameImpl()->frame()->document(); | 1749 Document* document = mainFrameImpl()->frame()->document(); |
| 1750 DCHECK(document); | 1750 DCHECK(document); |
| 1751 // Document may have already removed the event listener, for instance, due | 1751 // Document may have already removed the event listener, for instance, due |
| 1752 // to a navigation, but remove it anyway. | 1752 // to a navigation, but remove it anyway. |
| 1753 document->removeEventListener(EventTypeNames::mousewheel, m_popupMouseWheelE
ventListener.release(), false); | 1753 document->removeEventListener(EventTypeNames::mousewheel, m_popupMouseWheelE
ventListener.release(), false); |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 LocalDOMWindow* WebViewImpl::pagePopupWindow() const | 1756 LocalDOMWindow* WebViewImpl::pagePopupWindow() const |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 | 1868 |
| 1869 TopControls& WebViewImpl::topControls() | 1869 TopControls& WebViewImpl::topControls() |
| 1870 { | 1870 { |
| 1871 return page()->frameHost().topControls(); | 1871 return page()->frameHost().topControls(); |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 void WebViewImpl::resizeViewWhileAnchored( | 1874 void WebViewImpl::resizeViewWhileAnchored( |
| 1875 FrameView* view, float topControlsHeight, bool topControlsShrinkLayout) | 1875 FrameView* view, float topControlsHeight, bool topControlsShrinkLayout) |
| 1876 { | 1876 { |
| 1877 DCHECK(mainFrameImpl()); | 1877 DCHECK(mainFrameImpl()); |
| 1878 DCHECK(mainFrameImpl()->frame()->isLocalFrame()); | |
| 1879 | 1878 |
| 1880 topControls().setHeight(topControlsHeight, topControlsShrinkLayout); | 1879 topControls().setHeight(topControlsHeight, topControlsShrinkLayout); |
| 1881 | 1880 |
| 1882 { | 1881 { |
| 1883 // Avoids unnecessary invalidations while various bits of state in TextA
utosizer are updated. | 1882 // Avoids unnecessary invalidations while various bits of state in TextA
utosizer are updated. |
| 1884 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); | 1883 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); |
| 1885 performResize(); | 1884 performResize(); |
| 1886 } | 1885 } |
| 1887 | 1886 |
| 1888 m_fullscreenController->updateSize(); | 1887 m_fullscreenController->updateSize(); |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 } | 2836 } |
| 2838 | 2837 |
| 2839 void WebViewImpl::didChangeWindowResizerRect() | 2838 void WebViewImpl::didChangeWindowResizerRect() |
| 2840 { | 2839 { |
| 2841 if (mainFrameImpl()->frameView()) | 2840 if (mainFrameImpl()->frameView()) |
| 2842 mainFrameImpl()->frameView()->windowResizerRectChanged(); | 2841 mainFrameImpl()->frameView()->windowResizerRectChanged(); |
| 2843 } | 2842 } |
| 2844 | 2843 |
| 2845 void WebViewImpl::reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool
hasPotentialPerformanceRegression) | 2844 void WebViewImpl::reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool
hasPotentialPerformanceRegression) |
| 2846 { | 2845 { |
| 2847 if (!mainFrameImpl() || !mainFrameImpl()->frame()->isLocalFrame()) | 2846 if (!mainFrameImpl()) |
| 2848 return; | 2847 return; |
| 2849 Document* document = mainFrameImpl()->frame()->document(); | 2848 Document* document = mainFrameImpl()->frame()->document(); |
| 2850 if (hasBlurryContent) | 2849 if (hasBlurryContent) |
| 2851 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); | 2850 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); |
| 2852 if (hasPotentialPerformanceRegression) | 2851 if (hasPotentialPerformanceRegression) |
| 2853 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform
anceRegression); | 2852 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform
anceRegression); |
| 2854 } | 2853 } |
| 2855 | 2854 |
| 2856 // WebView -------------------------------------------------------------------- | 2855 // WebView -------------------------------------------------------------------- |
| 2857 | 2856 |
| (...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4597 { | 4596 { |
| 4598 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4597 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4599 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4598 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4600 if (!page()) | 4599 if (!page()) |
| 4601 return 1; | 4600 return 1; |
| 4602 | 4601 |
| 4603 return page()->deviceScaleFactor(); | 4602 return page()->deviceScaleFactor(); |
| 4604 } | 4603 } |
| 4605 | 4604 |
| 4606 } // namespace blink | 4605 } // namespace blink |
| OLD | NEW |