Java Code Examples for org.chromium.chrome.browser.tab.Tab#onActivityHidden()

The following examples show how to use org.chromium.chrome.browser.tab.Tab#onActivityHidden() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChromeActivity.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void onStopWithNative() {
    Tab tab = getActivityTab();
    if (tab != null && !hasWindowFocus()) tab.onActivityHidden();
    if (mAppMenuHandler != null) mAppMenuHandler.hideAppMenu();
    if (mGSAServiceClient != null) {
        mGSAServiceClient.disconnect();
        mGSAServiceClient = null;
        if (mSyncStateChangedListener != null) {
            ProfileSyncService syncService = ProfileSyncService.get();
            if (syncService != null) {
                syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
            }
            mSyncStateChangedListener = null;
        }
    }
    super.onStopWithNative();
}
 
Example 2
Source File: ChromeActivity.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void onStopWithNative() {
    Tab tab = getActivityTab();
    if (tab != null && !hasWindowFocus()) tab.onActivityHidden();
    if (mAppMenuHandler != null) mAppMenuHandler.hideAppMenu();

    if (GSAState.getInstance(this).isGsaAvailable()) {
        GSAAccountChangeListener.getInstance().disconnect();
        if (mSyncStateChangedListener != null) {
            ProfileSyncService syncService = ProfileSyncService.get();
            if (syncService != null) {
                syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
            }
            mSyncStateChangedListener = null;
        }
    }
    super.onStopWithNative();
}
 
Example 3
Source File: ChromeActivity.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void onStopWithNative() {
    Tab tab = getActivityTab();
    if (tab != null && !hasWindowFocus()) tab.onActivityHidden();
    if (mAppMenuHandler != null) mAppMenuHandler.hideAppMenu();

    if (GSAState.getInstance(this).isGsaAvailable()) {
        GSAAccountChangeListener.getInstance().disconnect();
        if (mSyncStateChangedListener != null) {
            ProfileSyncService syncService = ProfileSyncService.get();
            if (syncService != null) {
                syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
            }
            mSyncStateChangedListener = null;
        }
    }
    super.onStopWithNative();
}
 
Example 4
Source File: ChromeActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    Tab tab = getActivityTab();
    if (tab == null) return;
    if (hasFocus) {
        tab.onActivityShown();
    } else {
        boolean stopped = ApplicationStatus.getStateForActivity(this) == ActivityState.STOPPED;
        if (stopped) tab.onActivityHidden();
    }
}
 
Example 5
Source File: ChromeActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    Tab tab = getActivityTab();
    if (tab == null) return;
    if (hasFocus) {
        tab.onActivityShown();
    } else {
        boolean stopped = ApplicationStatus.getStateForActivity(this) == ActivityState.STOPPED;
        if (stopped) tab.onActivityHidden();
    }
}
 
Example 6
Source File: ChromeActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    maybeRemoveWindowBackground();

    Tab tab = getActivityTab();
    if (tab == null) return;
    if (hasFocus) {
        tab.onActivityShown();
    } else {
        boolean stopped = ApplicationStatus.getStateForActivity(this) == ActivityState.STOPPED;
        if (stopped) tab.onActivityHidden();
    }
}