Java Code Examples for org.chromium.base.ApplicationStatus#ApplicationStateListener

The following examples show how to use org.chromium.base.ApplicationStatus#ApplicationStateListener . 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: WebApkInstaller.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
private ApplicationStatus.ApplicationStateListener createApplicationStateListener() {
    return new ApplicationStatus.ApplicationStateListener() {
        @Override
        public void onApplicationStateChange(int newState) {
            if (!ApplicationStatus.hasVisibleActivities()) return;
            /**
             * Currently WebAPKs aren't installed by Play. A user can cancel the installation
             * when the Android native installation dialog shows. The only way to detect the
             * user cancelling the installation is to check whether the WebAPK is installed
             * when Chrome is resumed. The monitoring of application state changes will be
             * removed once WebAPKs are installed by Play.
             */
            if (newState == ApplicationState.HAS_RUNNING_ACTIVITIES
                    && !isWebApkInstalled(mWebApkPackageName)) {
                onInstallFinishedInternal(false);
                return;
            }
        }
    };
}
 
Example 2
Source File: AppBannerInfoBarDelegateAndroid.java    From delion with Apache License 2.0 5 votes vote down vote up
private ApplicationStatus.ApplicationStateListener createApplicationStateListener() {
    return new ApplicationStatus.ApplicationStateListener() {
        @Override
        public void onApplicationStateChange(int newState) {
            if (!ApplicationStatus.hasVisibleActivities()) return;
            nativeUpdateInstallState(mNativePointer);
        }
    };
}
 
Example 3
Source File: AppBannerInfoBarDelegateAndroid.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private ApplicationStatus.ApplicationStateListener createApplicationStateListener() {
    return new ApplicationStatus.ApplicationStateListener() {
        @Override
        public void onApplicationStateChange(int newState) {
            if (!ApplicationStatus.hasVisibleActivities()) return;
            nativeUpdateInstallState(mNativePointer);
        }
    };
}
 
Example 4
Source File: AppBannerInfoBarDelegateAndroid.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private ApplicationStatus.ApplicationStateListener createApplicationStateListener() {
    return new ApplicationStatus.ApplicationStateListener() {
        @Override
        public void onApplicationStateChange(int newState) {
            if (!ApplicationStatus.hasVisibleActivities()) return;
            nativeUpdateInstallState(mNativePointer);
        }
    };
}