| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return adoptRef(new ScrollingTree(scrollingCoordinator)); | 46 return adoptRef(new ScrollingTree(scrollingCoordinator)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 ScrollingTree::ScrollingTree(ScrollingCoordinator* scrollingCoordinator) | 49 ScrollingTree::ScrollingTree(ScrollingCoordinator* scrollingCoordinator) |
| 50 : m_scrollingCoordinator(scrollingCoordinator) | 50 : m_scrollingCoordinator(scrollingCoordinator) |
| 51 , m_hasWheelEventHandlers(false) | 51 , m_hasWheelEventHandlers(false) |
| 52 , m_canGoBack(false) | 52 , m_canGoBack(false) |
| 53 , m_canGoForward(false) | 53 , m_canGoForward(false) |
| 54 , m_mainFramePinnedToTheLeft(false) | 54 , m_mainFramePinnedToTheLeft(false) |
| 55 , m_mainFramePinnedToTheRight(false) | 55 , m_mainFramePinnedToTheRight(false) |
| 56 , m_mainFrameIsRubberBanding(false) | |
| 57 , m_scrollingPerformanceLoggingEnabled(false) | 56 , m_scrollingPerformanceLoggingEnabled(false) |
| 58 , m_isHandlingProgrammaticScroll(false) | 57 , m_isHandlingProgrammaticScroll(false) |
| 59 { | 58 { |
| 60 } | 59 } |
| 61 | 60 |
| 62 ScrollingTree::~ScrollingTree() | 61 ScrollingTree::~ScrollingTree() |
| 63 { | 62 { |
| 64 ASSERT(!m_scrollingCoordinator); | 63 ASSERT(!m_scrollingCoordinator); |
| 65 } | 64 } |
| 66 | 65 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 return m_canGoBack; | 255 return m_canGoBack; |
| 257 } | 256 } |
| 258 | 257 |
| 259 bool ScrollingTree::canGoForward() | 258 bool ScrollingTree::canGoForward() |
| 260 { | 259 { |
| 261 MutexLocker lock(m_swipeStateMutex); | 260 MutexLocker lock(m_swipeStateMutex); |
| 262 | 261 |
| 263 return m_canGoForward; | 262 return m_canGoForward; |
| 264 } | 263 } |
| 265 | 264 |
| 266 bool ScrollingTree::isRubberBandInProgress() | |
| 267 { | |
| 268 MutexLocker lock(m_mutex); | |
| 269 | |
| 270 return m_mainFrameIsRubberBanding; | |
| 271 } | |
| 272 | |
| 273 void ScrollingTree::setMainFrameIsRubberBanding(bool isRubberBanding) | |
| 274 { | |
| 275 MutexLocker locker(m_mutex); | |
| 276 | |
| 277 m_mainFrameIsRubberBanding = isRubberBanding; | |
| 278 } | |
| 279 | |
| 280 bool ScrollingTree::willWheelEventStartSwipeGesture(const PlatformWheelEvent& wh
eelEvent) | 265 bool ScrollingTree::willWheelEventStartSwipeGesture(const PlatformWheelEvent& wh
eelEvent) |
| 281 { | 266 { |
| 282 if (wheelEvent.phase() != PlatformWheelEventPhaseBegan) | 267 if (wheelEvent.phase() != PlatformWheelEventPhaseBegan) |
| 283 return false; | 268 return false; |
| 284 if (!wheelEvent.deltaX()) | 269 if (!wheelEvent.deltaX()) |
| 285 return false; | 270 return false; |
| 286 | 271 |
| 287 MutexLocker lock(m_swipeStateMutex); | 272 MutexLocker lock(m_swipeStateMutex); |
| 288 | 273 |
| 289 if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && m_canGoBack) | 274 if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && m_canGoBack) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 300 } | 285 } |
| 301 | 286 |
| 302 bool ScrollingTree::scrollingPerformanceLoggingEnabled() | 287 bool ScrollingTree::scrollingPerformanceLoggingEnabled() |
| 303 { | 288 { |
| 304 return m_scrollingPerformanceLoggingEnabled; | 289 return m_scrollingPerformanceLoggingEnabled; |
| 305 } | 290 } |
| 306 | 291 |
| 307 } // namespace WebCore | 292 } // namespace WebCore |
| 308 | 293 |
| 309 #endif // ENABLE(THREADED_SCROLLING) | 294 #endif // ENABLE(THREADED_SCROLLING) |
| OLD | NEW |