| 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 3808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3819 void WebViewImpl::RegisterViewportLayersWithCompositor() { | 3819 void WebViewImpl::RegisterViewportLayersWithCompositor() { |
| 3820 DCHECK(layer_tree_view_); | 3820 DCHECK(layer_tree_view_); |
| 3821 | 3821 |
| 3822 if (!GetPage()->MainFrame() || !GetPage()->MainFrame()->IsLocalFrame()) | 3822 if (!GetPage()->MainFrame() || !GetPage()->MainFrame()->IsLocalFrame()) |
| 3823 return; | 3823 return; |
| 3824 | 3824 |
| 3825 Document* document = GetPage()->DeprecatedLocalMainFrame()->GetDocument(); | 3825 Document* document = GetPage()->DeprecatedLocalMainFrame()->GetDocument(); |
| 3826 | 3826 |
| 3827 DCHECK(document); | 3827 DCHECK(document); |
| 3828 | 3828 |
| 3829 // Get the outer viewport scroll layer. | 3829 // Get the outer viewport scroll layers. |
| 3830 GraphicsLayer* layout_viewport_container_layer = |
| 3831 GetPage()->GlobalRootScrollerController().RootContainerLayer(); |
| 3832 WebLayer* layout_viewport_container_web_layer = |
| 3833 layout_viewport_container_layer |
| 3834 ? layout_viewport_container_layer->PlatformLayer() |
| 3835 : nullptr; |
| 3836 |
| 3830 GraphicsLayer* layout_viewport_scroll_layer = | 3837 GraphicsLayer* layout_viewport_scroll_layer = |
| 3831 GetPage()->GlobalRootScrollerController().RootScrollerLayer(); | 3838 GetPage()->GlobalRootScrollerController().RootScrollerLayer(); |
| 3832 WebLayer* layout_viewport_web_layer = | 3839 WebLayer* layout_viewport_scroll_web_layer = |
| 3833 layout_viewport_scroll_layer | 3840 layout_viewport_scroll_layer |
| 3834 ? layout_viewport_scroll_layer->PlatformLayer() | 3841 ? layout_viewport_scroll_layer->PlatformLayer() |
| 3835 : nullptr; | 3842 : nullptr; |
| 3836 | 3843 |
| 3837 VisualViewport& visual_viewport = GetPage()->GetVisualViewport(); | 3844 VisualViewport& visual_viewport = GetPage()->GetVisualViewport(); |
| 3838 | 3845 |
| 3839 // TODO(bokan): This was moved here from when registerViewportLayers was a | 3846 // TODO(bokan): This was moved here from when registerViewportLayers was a |
| 3840 // part of VisualViewport and maybe doesn't belong here. See comment inside | 3847 // part of VisualViewport and maybe doesn't belong here. See comment inside |
| 3841 // the mehtod. | 3848 // the mehtod. |
| 3842 visual_viewport.SetScrollLayerOnScrollbars(layout_viewport_web_layer); | 3849 visual_viewport.SetScrollLayerOnScrollbars(layout_viewport_scroll_web_layer); |
| 3843 | 3850 |
| 3844 layer_tree_view_->RegisterViewportLayers( | 3851 layer_tree_view_->RegisterViewportLayers( |
| 3845 visual_viewport.OverscrollElasticityLayer()->PlatformLayer(), | 3852 visual_viewport.OverscrollElasticityLayer()->PlatformLayer(), |
| 3846 visual_viewport.PageScaleLayer()->PlatformLayer(), | 3853 visual_viewport.PageScaleLayer()->PlatformLayer(), |
| 3854 visual_viewport.ContainerLayer()->PlatformLayer(), |
| 3855 layout_viewport_container_web_layer, |
| 3847 visual_viewport.ScrollLayer()->PlatformLayer(), | 3856 visual_viewport.ScrollLayer()->PlatformLayer(), |
| 3848 layout_viewport_web_layer); | 3857 layout_viewport_scroll_web_layer); |
| 3849 } | 3858 } |
| 3850 | 3859 |
| 3851 void WebViewImpl::SetRootGraphicsLayer(GraphicsLayer* graphics_layer) { | 3860 void WebViewImpl::SetRootGraphicsLayer(GraphicsLayer* graphics_layer) { |
| 3852 if (!layer_tree_view_) | 3861 if (!layer_tree_view_) |
| 3853 return; | 3862 return; |
| 3854 | 3863 |
| 3855 // In SPv2, setRootLayer is used instead. | 3864 // In SPv2, setRootLayer is used instead. |
| 3856 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3865 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 3857 | 3866 |
| 3858 VisualViewport& visual_viewport = GetPage()->GetVisualViewport(); | 3867 VisualViewport& visual_viewport = GetPage()->GetVisualViewport(); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4151 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4160 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4152 return nullptr; | 4161 return nullptr; |
| 4153 return focused_frame; | 4162 return focused_frame; |
| 4154 } | 4163 } |
| 4155 | 4164 |
| 4156 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4165 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4157 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4166 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4158 } | 4167 } |
| 4159 | 4168 |
| 4160 } // namespace blink | 4169 } // namespace blink |
| OLD | NEW |