OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 | 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 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/frame/DOMWindowLifecycleNotifier.h" | 28 #include "core/frame/DOMWindowLifecycleNotifier.h" |
29 | 29 |
30 #include "core/frame/DOMWindowLifecycleObserver.h" | 30 #include "core/frame/DOMWindowLifecycleObserver.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 DOMWindowLifecycleNotifier::DOMWindowLifecycleNotifier(LocalDOMWindow* context) | |
35 : LifecycleNotifier<LocalDOMWindow, DOMWindowLifecycleObserver>(context) | |
36 { | |
37 } | |
38 | |
39 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window,
const AtomicString& eventType) | 34 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window,
const AtomicString& eventType) |
40 { | 35 { |
41 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 36 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
42 for (DOMWindowLifecycleObserver* observer : m_observers) | 37 for (DOMWindowLifecycleObserver* observer : m_observers) |
43 observer->didAddEventListener(window, eventType); | 38 observer->didAddEventListener(window, eventType); |
44 } | 39 } |
45 | 40 |
46 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo
w, const AtomicString& eventType) | 41 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo
w, const AtomicString& eventType) |
47 { | 42 { |
48 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 43 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
49 for (DOMWindowLifecycleObserver* observer : m_observers) | 44 for (DOMWindowLifecycleObserver* observer : m_observers) |
50 observer->didRemoveEventListener(window, eventType); | 45 observer->didRemoveEventListener(window, eventType); |
51 } | 46 } |
52 | 47 |
53 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w
indow) | 48 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w
indow) |
54 { | 49 { |
55 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 50 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
56 for (DOMWindowLifecycleObserver* observer : m_observers) | 51 for (DOMWindowLifecycleObserver* observer : m_observers) |
57 observer->didRemoveAllEventListeners(window); | 52 observer->didRemoveAllEventListeners(window); |
58 } | 53 } |
59 | 54 |
60 } // namespace blink | 55 } // namespace blink |
OLD | NEW |