| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 return mediaSliderContainer; | 427 return mediaSliderContainer; |
| 428 default: | 428 default: |
| 429 return sliderContainer; | 429 return sliderContainer; |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 void SliderContainerElement::updateTouchEventHandlerRegistry() { | 433 void SliderContainerElement::updateTouchEventHandlerRegistry() { |
| 434 if (m_hasTouchEventHandler) { | 434 if (m_hasTouchEventHandler) { |
| 435 return; | 435 return; |
| 436 } | 436 } |
| 437 if (document().frameHost() && | 437 if (document().page() && |
| 438 document().lifecycle().state() < DocumentLifecycle::Stopping) { | 438 document().lifecycle().state() < DocumentLifecycle::Stopping) { |
| 439 EventHandlerRegistry& registry = | 439 EventHandlerRegistry& registry = document().page()->eventHandlerRegistry(); |
| 440 document().frameHost()->eventHandlerRegistry(); | |
| 441 registry.didAddEventHandler( | 440 registry.didAddEventHandler( |
| 442 *this, EventHandlerRegistry::TouchStartOrMoveEventPassive); | 441 *this, EventHandlerRegistry::TouchStartOrMoveEventPassive); |
| 443 m_hasTouchEventHandler = true; | 442 m_hasTouchEventHandler = true; |
| 444 } | 443 } |
| 445 } | 444 } |
| 446 | 445 |
| 447 void SliderContainerElement::didMoveToNewDocument(Document& oldDocument) { | 446 void SliderContainerElement::didMoveToNewDocument(Document& oldDocument) { |
| 448 updateTouchEventHandlerRegistry(); | 447 updateTouchEventHandlerRegistry(); |
| 449 HTMLElement::didMoveToNewDocument(oldDocument); | 448 HTMLElement::didMoveToNewDocument(oldDocument); |
| 450 } | 449 } |
| 451 | 450 |
| 452 void SliderContainerElement::removeAllEventListeners() { | 451 void SliderContainerElement::removeAllEventListeners() { |
| 453 Node::removeAllEventListeners(); | 452 Node::removeAllEventListeners(); |
| 454 m_hasTouchEventHandler = false; | 453 m_hasTouchEventHandler = false; |
| 455 } | 454 } |
| 456 | 455 |
| 457 } // namespace blink | 456 } // namespace blink |
| OLD | NEW |