本文整理汇总了Java中org.chromium.chrome.browser.invalidation.InvalidationController类的典型用法代码示例。如果您正苦于以下问题:Java InvalidationController类的具体用法?Java InvalidationController怎么用?Java InvalidationController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidationController类属于org.chromium.chrome.browser.invalidation包,在下文中一共展示了InvalidationController类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RecentTabsManager
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Create an RecentTabsManager to be used with RecentTabsPage and RecentTabsRowAdapter.
*
* @param tab The Tab that is showing this recent tabs page.
* @param profile Profile that is associated with the current session.
* @param context the Android context this manager will work in.
*/
public RecentTabsManager(Tab tab, Profile profile, Context context) {
mProfile = profile;
mTab = tab;
mForeignSessionHelper = buildForeignSessionHelper(mProfile);
mNewTabPagePrefs = buildNewTabPagePrefs(mProfile);
mFaviconHelper = buildFaviconHelper();
mRecentlyClosedBridge = buildRecentlyClosedBridge(mProfile);
mSignInManager = SigninManager.get(context);
mContext = context;
updateRecentlyClosedTabs();
registerForForeignSessionUpdates();
updateForeignSessions();
mForeignSessionHelper.triggerSessionSync();
registerForSignInAndSyncNotifications();
InvalidationController.get(mContext).onRecentTabsPageOpened();
}
示例2: destroy
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Should be called when this object is no longer needed. Performs necessary listener tear down.
*/
public void destroy() {
mIsDestroyed = true;
AndroidSyncSettings.unregisterObserver(mContext, this);
mSignInManager.removeSignInStateObserver(this);
mSignInManager = null;
mFaviconHelper.destroy();
mFaviconHelper = null;
mRecentlyClosedBridge.destroy();
mRecentlyClosedBridge = null;
mForeignSessionHelper.destroy();
mForeignSessionHelper = null;
mUpdatedCallback = null;
mNewTabPagePrefs.destroy();
mNewTabPagePrefs = null;
InvalidationController.get(mContext).onRecentTabsPageClosed();
}
示例3: destroy
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Should be called when this object is no longer needed. Performs necessary listener tear down.
*/
public void destroy() {
mIsDestroyed = true;
AndroidSyncSettings.unregisterObserver(mContext, this);
mSignInManager.removeSignInStateObserver(this);
mSignInManager = null;
mFaviconHelper.destroy();
mFaviconHelper = null;
mRecentlyClosedTabManager.destroy();
mRecentlyClosedTabManager = null;
mForeignSessionHelper.destroy();
mForeignSessionHelper = null;
mUpdatedCallback = null;
mPrefs.destroy();
mPrefs = null;
InvalidationController.get(mContext).onRecentTabsPageClosed();
}
示例4: configureSyncDataTypes
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
private void configureSyncDataTypes() {
if (maybeDisableSync()) return;
boolean syncEverything = mSyncEverything.isChecked();
mProfileSyncService.setPreferredDataTypes(syncEverything, getSelectedModelTypes());
// Update the invalidation listener with the set of types we are enabling.
InvalidationController invController = InvalidationController.get(getActivity());
invController.ensureStartedAndUpdateRegisteredTypes();
}
示例5: destroy
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Should be called when this object is no longer needed. Performs necessary listener tear down.
*/
public void destroy() {
AndroidSyncSettings.unregisterObserver(mContext, this);
mSignInManager.removeSignInStateObserver(this);
mSignInManager = null;
mFaviconHelper.destroy();
mFaviconHelper = null;
mRecentlyClosedBridge.destroy();
mRecentlyClosedBridge = null;
mForeignSessionHelper.destroy();
mForeignSessionHelper = null;
mUpdatedCallback = null;
mNewTabPagePrefs.destroy();
mNewTabPagePrefs = null;
if (mProfileDataCache != null) {
mProfileDataCache.destroy();
mProfileDataCache = null;
}
InvalidationController.get(mContext).onRecentTabsPageClosed();
}
示例6: start
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Starts sync if the master sync flag is enabled.
*
* Affects native sync, the invalidation controller, and the Android sync settings.
*/
public void start() {
ThreadUtils.assertOnUiThread();
if (AndroidSyncSettings.isMasterSyncEnabled(mContext)) {
Log.d(TAG, "Enabling sync");
InvalidationController.get(mContext).ensureStartedAndUpdateRegisteredTypes();
mProfileSyncService.requestStart();
AndroidSyncSettings.enableChromeSync(mContext);
}
}
示例7: stop
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Stops Sync if a user is currently signed in.
*
* Affects native sync, the invalidation controller, and the Android sync settings.
*/
public void stop() {
ThreadUtils.assertOnUiThread();
Log.d(TAG, "Disabling sync");
InvalidationController.get(mContext).stop();
mProfileSyncService.requestStop();
if (AndroidSyncSettings.isMasterSyncEnabled(mContext)) {
// Only disable Android's Chrome sync setting if we weren't disabled
// by the master sync setting. This way, when master sync is enabled
// they will both be on and sync will start again.
AndroidSyncSettings.disableChromeSync(mContext);
}
}
示例8: configureSyncDataTypes
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
private void configureSyncDataTypes() {
if (maybeDisableSync()) return;
boolean syncEverything = mSyncEverything.isChecked();
mProfileSyncService.setPreferredDataTypes(syncEverything, getSelectedModelTypes());
// Update the invalidation listener with the set of types we are enabling.
InvalidationController invController =
InvalidationController.get(getActivity());
invController.ensureStartedAndUpdateRegisteredTypes();
}
示例9: RecentTabsManager
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
/**
* Create an RecentTabsManager to be used with RecentTabsPage and RecentTabsRowAdapter.
*
* @param tab The Tab that is showing this recent tabs page.
* @param profile Profile that is associated with the current session.
* @param context the Android context this manager will work in.
*/
public RecentTabsManager(Tab tab, Profile profile, Context context) {
mProfile = profile;
mTab = tab;
mForeignSessionHelper = new ForeignSessionHelper(profile);
mPrefs = new RecentTabsPagePrefs(profile);
mFaviconHelper = new FaviconHelper();
mRecentlyClosedTabManager = sRecentlyClosedTabManagerForTests != null
? sRecentlyClosedTabManagerForTests
: new RecentlyClosedBridge(profile);
mSignInManager = SigninManager.get(context);
mContext = context;
mRecentlyClosedTabManager.setTabsUpdatedRunnable(new Runnable() {
@Override
public void run() {
updateRecentlyClosedTabs();
postUpdate();
}
});
updateRecentlyClosedTabs();
registerForForeignSessionUpdates();
updateForeignSessions();
mForeignSessionHelper.triggerSessionSync();
registerForSignInAndSyncNotifications();
InvalidationController.get(mContext).onRecentTabsPageOpened();
}
示例10: start
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
private void start() {
ThreadUtils.assertOnUiThread();
if (mSyncStatusHelper.isMasterSyncAutomaticallyEnabled()) {
Log.d(TAG, "Enabling sync");
Account account = mChromeSigninController.getSignedInUser();
InvalidationController.get(mContext).start();
mProfileSyncService.enableSync();
mSyncStatusHelper.enableAndroidSync(account);
}
}
示例11: stop
import org.chromium.chrome.browser.invalidation.InvalidationController; //导入依赖的package包/类
private void stop() {
ThreadUtils.assertOnUiThread();
if (mChromeSigninController.isSignedIn()) {
Log.d(TAG, "Disabling sync");
Account account = mChromeSigninController.getSignedInUser();
InvalidationController.get(mContext).stop();
mProfileSyncService.disableSync();
mSyncStatusHelper.disableAndroidSync(account);
}
}