use of org.chromium.base.Promise in project AndroidChromium by JackyAndroid.
the class SyncUserDataWiper method wipeSyncUserData.
/**
* Wipes the user's bookmarks and sync data.
* @return A promise which will be fulfilled once the data is wiped.
*/
public static Promise<Void> wipeSyncUserData() {
final Promise<Void> promise = new Promise<>();
final BookmarkModel model = new BookmarkModel();
model.runAfterBookmarkModelLoaded(new Runnable() {
@Override
public void run() {
model.removeAllUserBookmarks();
model.destroy();
PrefServiceBridge.getInstance().clearBrowsingData(new OnClearBrowsingDataListener() {
@Override
public void onBrowsingDataCleared() {
promise.fulfill(null);
}
}, SYNC_DATA_TYPES, TimePeriod.ALL_TIME);
}
});
return promise;
}
Aggregations