org.chromium.chrome.browser.document.DocumentActivity Java Examples

The following examples show how to use org.chromium.chrome.browser.document.DocumentActivity. 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: ActivityDelegate.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether or not the Intent corresponds to an Activity that should be tracked.
 * @param isIncognito Whether or not the TabModel is managing incognito tabs.
 * @param intent Intent used to launch the Activity.
 * @return Whether or not to track the Activity.
 */
public boolean isValidActivity(boolean isIncognito, Intent intent) {
    if (intent == null) return false;
    String desiredClassName = isIncognito ? mIncognitoClass.getName() : mRegularClass.getName();
    String desiredLegacyClassName = isIncognito
            ? DocumentActivity.LEGACY_INCOGNITO_CLASS_NAME
            : DocumentActivity.LEGACY_CLASS_NAME;
    String className = null;
    if (intent.getComponent() == null) {
        ResolveInfo resolveInfo = ExternalNavigationDelegateImpl.resolveActivity(intent);
        if (resolveInfo != null) className = resolveInfo.activityInfo.name;
    } else {
        className = intent.getComponent().getClassName();
    }

    return TextUtils.equals(className, desiredClassName)
            || TextUtils.equals(className, desiredLegacyClassName);
}
 
Example #2
Source File: ActivityDelegate.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether or not the Intent corresponds to an Activity that should be tracked.
 * @param isIncognito Whether or not the TabModel is managing incognito tabs.
 * @param intent Intent used to launch the Activity.
 * @return Whether or not to track the Activity.
 */
public boolean isValidActivity(boolean isIncognito, Intent intent) {
    if (intent == null) return false;
    String desiredClassName = isIncognito ? mIncognitoClass.getName() : mRegularClass.getName();
    String desiredLegacyClassName = isIncognito
            ? DocumentActivity.LEGACY_INCOGNITO_CLASS_NAME
            : DocumentActivity.LEGACY_CLASS_NAME;
    String className = null;
    if (intent.getComponent() == null) {
        ResolveInfo resolveInfo = ExternalNavigationDelegateImpl.resolveActivity(intent);
        if (resolveInfo != null) className = resolveInfo.activityInfo.name;
    } else {
        className = intent.getComponent().getClassName();
    }

    return TextUtils.equals(className, desiredClassName)
            || TextUtils.equals(className, desiredLegacyClassName);
}
 
Example #3
Source File: ActivityDelegate.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether or not the Intent corresponds to an Activity that should be tracked.
 * @param isIncognito Whether or not the TabModel is managing incognito tabs.
 * @param intent Intent used to launch the Activity.
 * @return Whether or not to track the Activity.
 */
public boolean isValidActivity(boolean isIncognito, Intent intent) {
    if (intent == null) return false;
    String desiredClassName = isIncognito ? mIncognitoClass.getName() : mRegularClass.getName();
    String desiredLegacyClassName = isIncognito
            ? DocumentActivity.LEGACY_INCOGNITO_CLASS_NAME
            : DocumentActivity.LEGACY_CLASS_NAME;
    String className = null;
    if (intent.getComponent() == null) {
        ResolveInfo resolveInfo = ExternalNavigationDelegateImpl.resolveActivity(intent);
        if (resolveInfo != null) className = resolveInfo.activityInfo.name;
    } else {
        className = intent.getComponent().getClassName();
    }

    return TextUtils.equals(className, desiredClassName)
            || TextUtils.equals(className, desiredLegacyClassName);
}
 
Example #4
Source File: DocumentModeAssassin.java    From delion with Apache License 2.0 4 votes vote down vote up
/** @return Interfaces with the Android ActivityManager. */
protected ActivityDelegate createActivityDelegate() {
    return new ActivityDelegateImpl(DocumentActivity.class, IncognitoDocumentActivity.class);
}
 
Example #5
Source File: DocumentModeAssassin.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/** @return Interfaces with the Android ActivityManager. */
protected ActivityDelegate createActivityDelegate() {
    return new ActivityDelegateImpl(DocumentActivity.class, IncognitoDocumentActivity.class);
}
 
Example #6
Source File: DocumentModeAssassin.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/** @return Interfaces with the Android ActivityManager. */
protected ActivityDelegate createActivityDelegate() {
    return new ActivityDelegateImpl(DocumentActivity.class, IncognitoDocumentActivity.class);
}