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

The following examples show how to use org.chromium.chrome.browser.policy.PolicyAuditor.AuditEvent. 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 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 #3
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 #4
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 #5
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 #6
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, "");
    }
}