org.chromium.chrome.browser.ntp.NativePageAssassin Java Examples

The following examples show how to use org.chromium.chrome.browser.ntp.NativePageAssassin. 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: Tab.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Triggers the hiding logic for the view backing the tab.
 */
public final void hide() {
    try {
        TraceEvent.begin("Tab.hide");
        if (isHidden()) return;
        mIsHidden = true;

        if (mContentViewCore != null) mContentViewCore.onHide();

        // Clean up any fullscreen state that might impact other tabs.
        if (mFullscreenManager != null) {
            mFullscreenManager.setPersistentFullscreenMode(false);
        }

        if (mTabUma != null) mTabUma.onHide();

        mTabRedirectHandler.clear();

        // Allow this tab's NativePage to be frozen if it stays hidden for a while.
        NativePageAssassin.getInstance().tabHidden(this);

        for (TabObserver observer : mObservers) observer.onHidden(this);
    } finally {
        TraceEvent.end("Tab.hide");
    }
}
 
Example #2
Source File: ChromeTabbedActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    // The conditions are expressed using ranges to capture intermediate levels possibly added
    // to the API in the future.
    if ((level >= TRIM_MEMORY_RUNNING_LOW && level < TRIM_MEMORY_UI_HIDDEN)
            || level >= TRIM_MEMORY_MODERATE) {
        NativePageAssassin.getInstance().freezeAllHiddenPages();
    }
}
 
Example #3
Source File: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Triggers the hiding logic for the view backing the tab.
 */
public final void hide() {
    try {
        TraceEvent.begin("Tab.hide");
        if (isHidden()) return;
        mIsHidden = true;

        if (mContentViewCore != null) mContentViewCore.onHide();

        // Clean up any fullscreen state that might impact other tabs.
        if (mFullscreenManager != null) {
            mFullscreenManager.setPersistentFullscreenMode(false);
            mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererToken);
            mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN;
        }

        if (mTabUma != null) mTabUma.onHide();

        mTabRedirectHandler.clear();

        cancelEnableFullscreenLoadDelay();

        // Allow this tab's NativePage to be frozen if it stays hidden for a while.
        NativePageAssassin.getInstance().tabHidden(this);

        for (TabObserver observer : mObservers) observer.onHidden(this);
    } finally {
        TraceEvent.end("Tab.hide");
    }
}
 
Example #4
Source File: ChromeTabbedActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    // The conditions are expressed using ranges to capture intermediate levels possibly added
    // to the API in the future.
    if ((level >= TRIM_MEMORY_RUNNING_LOW && level < TRIM_MEMORY_UI_HIDDEN)
            || level >= TRIM_MEMORY_MODERATE) {
        NativePageAssassin.getInstance().freezeAllHiddenPages();
    }
}
 
Example #5
Source File: Tab.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Triggers the hiding logic for the view backing the tab.
 */
public final void hide() {
    try {
        TraceEvent.begin("Tab.hide");
        if (isHidden()) return;
        mIsHidden = true;

        if (mContentViewCore != null) mContentViewCore.onHide();
        if (mBlimpContents != null) mBlimpContents.hide();

        // Clean up any fullscreen state that might impact other tabs.
        if (mFullscreenManager != null) {
            mFullscreenManager.setPersistentFullscreenMode(false);
        }

        if (mTabUma != null) mTabUma.onHide();

        mTabRedirectHandler.clear();

        // Allow this tab's NativePage to be frozen if it stays hidden for a while.
        NativePageAssassin.getInstance().tabHidden(this);

        for (TabObserver observer : mObservers) observer.onHidden(this);
    } finally {
        TraceEvent.end("Tab.hide");
    }
}
 
Example #6
Source File: ChromeTabbedActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    // The conditions are expressed using ranges to capture intermediate levels possibly added
    // to the API in the future.
    if ((level >= TRIM_MEMORY_RUNNING_LOW && level < TRIM_MEMORY_UI_HIDDEN)
            || level >= TRIM_MEMORY_MODERATE) {
        NativePageAssassin.getInstance().freezeAllHiddenPages();
    }
}