| Index: Source/core/frame/LocalDOMWindow.cpp
|
| diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
|
| index 9bdf3d277d7123b3121055e6e2cafbd70358e97f..21ea7a4fd548428bda10d12abae0ed2e024e0215 100644
|
| --- a/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -382,8 +382,7 @@ bool LocalDOMWindow::canShowModalDialogNow(const LocalFrame* frame)
|
| }
|
|
|
| LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
|
| - : DOMWindowLifecycleNotifier(this)
|
| - , m_frameObserver(WindowFrameObserver::create(this, frame))
|
| + : m_frameObserver(WindowFrameObserver::create(this, frame))
|
| , m_shouldPrintWhenFinishedLoading(false)
|
| #if ENABLE(ASSERT)
|
| , m_hasBeenReset(false)
|
| @@ -901,9 +900,9 @@ void LocalDOMWindow::focus(ExecutionContext* context)
|
|
|
| ASSERT(context);
|
|
|
| - bool allowFocus = context->isWindowInteractionAllowed();
|
| + bool allowFocus = context->isWindowFocusAllowed();
|
| if (allowFocus) {
|
| - context->consumeWindowInteraction();
|
| + context->consumeWindowFocus();
|
| } else {
|
| ASSERT(isMainThread());
|
| allowFocus = opener() && (opener() != this) && (toDocument(context)->domWindow() == opener());
|
| @@ -1506,7 +1505,7 @@ bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<
|
| document->addListenerTypeIfNeeded(eventType);
|
| }
|
|
|
| - notifyAddEventListener(this, eventType);
|
| + lifecycleNotifier().notifyAddEventListener(this, eventType);
|
|
|
| if (eventType == EventTypeNames::unload) {
|
| UseCounter::count(document(), UseCounter::DocumentUnloadRegistered);
|
| @@ -1535,7 +1534,7 @@ bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, PassRefP
|
| if (frame() && frame()->host())
|
| frame()->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eventType);
|
|
|
| - notifyRemoveEventListener(this, eventType);
|
| + lifecycleNotifier().notifyRemoveEventListener(this, eventType);
|
|
|
| if (eventType == EventTypeNames::unload) {
|
| removeUnloadEventListener(this);
|
| @@ -1599,7 +1598,7 @@ void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo
|
| EventTarget::removeAllEventListeners();
|
|
|
| if (mode == DoBroadcastListenerRemoval) {
|
| - notifyRemoveAllEventListeners(this);
|
| + lifecycleNotifier().notifyRemoveAllEventListeners(this);
|
| if (frame() && frame()->host())
|
| frame()->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
|
| }
|
| @@ -1792,6 +1791,16 @@ void LocalDOMWindow::showModalDialog(const String& urlString, const String& dial
|
| dialogFrame->host()->chrome().runModal();
|
| }
|
|
|
| +DOMWindowLifecycleNotifier& LocalDOMWindow::lifecycleNotifier()
|
| +{
|
| + return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWindow>::lifecycleNotifier());
|
| +}
|
| +
|
| +PassOwnPtr<LifecycleNotifier<LocalDOMWindow>> LocalDOMWindow::createLifecycleNotifier()
|
| +{
|
| + return DOMWindowLifecycleNotifier::create(this);
|
| +}
|
| +
|
| void LocalDOMWindow::trace(Visitor* visitor)
|
| {
|
| #if ENABLE(OILPAN)
|
| @@ -1818,7 +1827,7 @@ void LocalDOMWindow::trace(Visitor* visitor)
|
| HeapSupplementable<LocalDOMWindow>::trace(visitor);
|
| #endif
|
| DOMWindow::trace(visitor);
|
| - DOMWindowLifecycleNotifier::trace(visitor);
|
| + LifecycleContext<LocalDOMWindow>::trace(visitor);
|
| }
|
|
|
| LocalFrame* LocalDOMWindow::frame() const
|
|
|