| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 m_lastMainThreadScrollingReasons(0) {} | 98 m_lastMainThreadScrollingReasons(0) {} |
| 99 | 99 |
| 100 ScrollingCoordinator::~ScrollingCoordinator() { | 100 ScrollingCoordinator::~ScrollingCoordinator() { |
| 101 DCHECK(!m_page); | 101 DCHECK(!m_page); |
| 102 } | 102 } |
| 103 | 103 |
| 104 DEFINE_TRACE(ScrollingCoordinator) { | 104 DEFINE_TRACE(ScrollingCoordinator) { |
| 105 visitor->trace(m_page); | 105 visitor->trace(m_page); |
| 106 visitor->trace(m_horizontalScrollbars); | 106 visitor->trace(m_horizontalScrollbars); |
| 107 visitor->trace(m_verticalScrollbars); | 107 visitor->trace(m_verticalScrollbars); |
| 108 visitor->trace(m_programmaticScrollCoordinator); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion( | 111 void ScrollingCoordinator::setShouldHandleScrollGestureOnMainThreadRegion( |
| 111 const Region& region) { | 112 const Region& region) { |
| 112 if (!m_page->mainFrame()->isLocalFrame() || | 113 if (!m_page->mainFrame()->isLocalFrame() || |
| 113 !m_page->deprecatedLocalMainFrame()->view()) | 114 !m_page->deprecatedLocalMainFrame()->view()) |
| 114 return; | 115 return; |
| 115 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame() | 116 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame() |
| 116 ->view() | 117 ->view() |
| 117 ->layoutViewportScrollableArea() | 118 ->layoutViewportScrollableArea() |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 if (WebLayer* scrollLayer = | 1188 if (WebLayer* scrollLayer = |
| 1188 frameView ? toWebLayer(frameView->layoutViewportScrollableArea() | 1189 frameView ? toWebLayer(frameView->layoutViewportScrollableArea() |
| 1189 ->layerForScrolling()) | 1190 ->layerForScrolling()) |
| 1190 : nullptr) { | 1191 : nullptr) { |
| 1191 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) != | 1192 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) != |
| 1192 scrollLayer->bounds(); | 1193 scrollLayer->bounds(); |
| 1193 } | 1194 } |
| 1194 return false; | 1195 return false; |
| 1195 } | 1196 } |
| 1196 | 1197 |
| 1198 ProgrammaticScrollCoordinator* |
| 1199 ScrollingCoordinator::programmaticScrollCoordinator() { |
| 1200 if (!m_programmaticScrollCoordinator) { |
| 1201 m_programmaticScrollCoordinator = ProgrammaticScrollCoordinator::create(); |
| 1202 } |
| 1203 |
| 1204 return m_programmaticScrollCoordinator.get(); |
| 1205 } |
| 1206 |
| 1197 } // namespace blink | 1207 } // namespace blink |
| OLD | NEW |