org.chromium.chrome.browser.policy.PolicyAuditor Java Examples

The following examples show how to use org.chromium.chrome.browser.policy.PolicyAuditor. 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: TabWebContentsObserver.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode,
        String description, String failingUrl, boolean wasIgnoredByHandler) {
    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onDidFailLoad(mTab, isProvisionalLoad, isMainFrame, errorCode,
                description, failingUrl);
    }

    if (isMainFrame) mTab.didFailPageLoad(errorCode);

    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyAuditEvent(mTab.getApplicationContext(), AuditEvent.OPEN_URL_FAILURE,
            failingUrl, description);
    if (errorCode == BLOCKED_BY_ADMINISTRATOR) {
        auditor.notifyAuditEvent(
                mTab.getApplicationContext(), AuditEvent.OPEN_URL_BLOCKED, failingUrl, "");
    }
}
 
Example #2
Source File: TabWebContentsObserver.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void didAttachInterstitialPage() {
    mTab.getInfoBarContainer().setVisibility(View.INVISIBLE);
    mTab.showRenderedPage();
    mTab.updateThemeColorIfNeeded(false);

    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onDidAttachInterstitialPage(mTab);
    }
    mTab.notifyLoadProgress(mTab.getProgress());

    mTab.updateFullscreenEnabledState();

    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(mTab.getWebContents()),
            mTab.getApplicationContext());
}
 
Example #3
Source File: TabWebContentsObserver.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode,
        String description, String failingUrl, boolean wasIgnoredByHandler) {
    mTab.updateThemeColorIfNeeded(true);
    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onDidFailLoad(mTab, isProvisionalLoad, isMainFrame, errorCode,
                description, failingUrl);
    }

    if (isMainFrame) mTab.didFailPageLoad(errorCode);

    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyAuditEvent(mTab.getApplicationContext(), AuditEvent.OPEN_URL_FAILURE,
            failingUrl, description);
    if (errorCode == BLOCKED_BY_ADMINISTRATOR) {
        auditor.notifyAuditEvent(
                mTab.getApplicationContext(), AuditEvent.OPEN_URL_BLOCKED, failingUrl, "");
    }
}
 
Example #4
Source File: TabWebContentsObserver.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void didAttachInterstitialPage() {
    mTab.getInfoBarContainer().setVisibility(View.INVISIBLE);
    mTab.showRenderedPage();
    mTab.updateThemeColorIfNeeded(false);

    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onDidAttachInterstitialPage(mTab);
    }
    mTab.notifyLoadProgress(mTab.getProgress());

    mTab.updateFullscreenEnabledState();

    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(mTab.getWebContents()),
            mTab.getApplicationContext());
}
 
Example #5
Source File: TabWebContentsObserver.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void didAttachInterstitialPage() {
    mTab.getInfoBarContainer().setVisibility(View.INVISIBLE);
    mTab.showRenderedPage();
    mTab.updateThemeColorIfNeeded(false);

    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onDidAttachInterstitialPage(mTab);
    }
    mTab.notifyLoadProgress(mTab.getProgress());

    mTab.updateFullscreenEnabledState();

    PolicyAuditor auditor = AppHooks.get().getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(mTab.getWebContents()),
            mTab.getApplicationContext());
}
 
Example #6
Source File: TabWebContentsObserver.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void didFinishLoad(long frameId, String validatedUrl, boolean isMainFrame) {
    if (isMainFrame) mTab.didFinishPageLoad();
    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyAuditEvent(
            mTab.getApplicationContext(), AuditEvent.OPEN_URL_SUCCESS, validatedUrl, "");
}
 
Example #7
Source File: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onSSLStateUpdated(Tab tab) {
    PolicyAuditor auditor =
            ((ChromeApplication) getApplicationContext()).getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(getWebContents()),
            getApplicationContext());
    updateFullscreenEnabledState();
    updateThemeColorIfNeeded(false);
}
 
Example #8
Source File: TabWebContentsObserver.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void didFinishLoad(long frameId, String validatedUrl, boolean isMainFrame) {
    if (isMainFrame) mTab.didFinishPageLoad();
    PolicyAuditor auditor =
            ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
    auditor.notifyAuditEvent(
            mTab.getApplicationContext(), AuditEvent.OPEN_URL_SUCCESS, validatedUrl, "");
}
 
Example #9
Source File: Tab.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onSSLStateUpdated(Tab tab) {
    PolicyAuditor auditor =
            ((ChromeApplication) getApplicationContext()).getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(getWebContents()),
            getApplicationContext());
    updateFullscreenEnabledState();
    updateThemeColorIfNeeded(false);
}
 
Example #10
Source File: TabWebContentsObserver.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void didFinishLoad(long frameId, String validatedUrl, boolean isMainFrame) {
    if (isMainFrame) mTab.didFinishPageLoad();
    PolicyAuditor auditor = AppHooks.get().getPolicyAuditor();
    auditor.notifyAuditEvent(
            mTab.getApplicationContext(), AuditEvent.OPEN_URL_SUCCESS, validatedUrl, "");
}
 
Example #11
Source File: TabWebContentsObserver.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void recordErrorInPolicyAuditor(String failingUrl, String description, int errorCode) {
    PolicyAuditor auditor = AppHooks.get().getPolicyAuditor();
    auditor.notifyAuditEvent(mTab.getApplicationContext(), AuditEvent.OPEN_URL_FAILURE,
            failingUrl, description);
    if (errorCode == BLOCKED_BY_ADMINISTRATOR) {
        auditor.notifyAuditEvent(
                mTab.getApplicationContext(), AuditEvent.OPEN_URL_BLOCKED, failingUrl, "");
    }
}
 
Example #12
Source File: Tab.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onSSLStateUpdated(Tab tab) {
    PolicyAuditor auditor = AppHooks.get().getPolicyAuditor();
    auditor.notifyCertificateFailure(
            PolicyAuditor.nativeGetCertificateFailure(getWebContents()),
            getApplicationContext());
    updateFullscreenEnabledState();
    updateThemeColorIfNeeded(false);
}
 
Example #13
Source File: ChromeApplication.java    From delion with Apache License 2.0 4 votes vote down vote up
/**
 * @return An instance of PolicyAuditor that notifies the policy system of the user's activity.
 * Only applicable when the user has a policy active, that is tracking the activity.
 */
public PolicyAuditor getPolicyAuditor() {
    // This class has a protected constructor to prevent accidental instantiation.
    return new PolicyAuditor() {};
}
 
Example #14
Source File: ChromeApplication.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**
 * @return An instance of PolicyAuditor that notifies the policy system of the user's activity.
 * Only applicable when the user has a policy active, that is tracking the activity.
 */
public PolicyAuditor getPolicyAuditor() {
    // This class has a protected constructor to prevent accidental instantiation.
    return new PolicyAuditor() {};
}
 
Example #15
Source File: AppHooks.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * @return An instance of PolicyAuditor that notifies the policy system of the user's activity.
 * Only applicable when the user has a policy active, that is tracking the activity.
 */
public PolicyAuditor getPolicyAuditor() {
    // This class has a protected constructor to prevent accidental instantiation.
    return new PolicyAuditor() {};
}