This source file includes following definitions.
- onTerminate
- addObserver
- removeObserver
- terminate
package org.chromium.chrome.browser;
import org.chromium.base.CalledByNative;
import org.chromium.base.ObserverList;
public class ApplicationLifetime {
public interface Observer {
void onTerminate(boolean restart);
}
private static ObserverList<Observer> sObservers = new ObserverList<Observer>();
public static void addObserver(Observer observer) {
sObservers.addObserver(observer);
}
public static void removeObserver(Observer observer) {
sObservers.removeObserver(observer);
}
@CalledByNative
public static void terminate(boolean restart) {
for (Observer observer : sObservers) {
observer.onTerminate(restart);
}
}
}