| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "core/page/PageLifecycleObserver.h" | 30 #include "core/page/PageLifecycleObserver.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 PageLifecycleNotifier::PageLifecycleNotifier(Page* context) | 34 PageLifecycleNotifier::PageLifecycleNotifier(Page* context) |
| 35 : LifecycleNotifier<Page, PageLifecycleObserver>(context) | 35 : LifecycleNotifier<Page, PageLifecycleObserver>(context) |
| 36 { | 36 { |
| 37 } | 37 } |
| 38 | 38 |
| 39 void PageLifecycleNotifier::addObserver(PageLifecycleObserver* observer) | |
| 40 { | |
| 41 LifecycleNotifier<Page, PageLifecycleObserver>::addObserver(observer); | |
| 42 } | |
| 43 | |
| 44 void PageLifecycleNotifier::removeObserver(PageLifecycleObserver* observer) | |
| 45 { | |
| 46 LifecycleNotifier<Page, PageLifecycleObserver>::removeObserver(observer); | |
| 47 } | |
| 48 | |
| 49 void PageLifecycleNotifier::notifyPageVisibilityChanged() | 39 void PageLifecycleNotifier::notifyPageVisibilityChanged() |
| 50 { | 40 { |
| 51 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 41 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
| 52 for (PageLifecycleObserver* observer : m_observers) | 42 for (PageLifecycleObserver* observer : m_observers) |
| 53 observer->pageVisibilityChanged(); | 43 observer->pageVisibilityChanged(); |
| 54 } | 44 } |
| 55 | 45 |
| 56 void PageLifecycleNotifier::notifyDidCommitLoad(LocalFrame* frame) | 46 void PageLifecycleNotifier::notifyDidCommitLoad(LocalFrame* frame) |
| 57 { | 47 { |
| 58 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 48 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
| 59 for (PageLifecycleObserver* observer : m_observers) | 49 for (PageLifecycleObserver* observer : m_observers) |
| 60 observer->didCommitLoad(frame); | 50 observer->didCommitLoad(frame); |
| 61 } | 51 } |
| 62 | 52 |
| 63 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |