use of org.chromium.chrome.browser.policy.PolicyAuditor in project AndroidChromium by JackyAndroid.
the class TabWebContentsObserver method didFailLoad.
@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, "");
}
}
use of org.chromium.chrome.browser.policy.PolicyAuditor in project AndroidChromium by JackyAndroid.
the class TabWebContentsObserver method didAttachInterstitialPage.
@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());
}
use of org.chromium.chrome.browser.policy.PolicyAuditor in project AndroidChromium by JackyAndroid.
the class TabWebContentsDelegateAndroid method addNewContents.
@CalledByNative
public boolean addNewContents(WebContents sourceWebContents, WebContents webContents, int disposition, Rect initialPosition, boolean userGesture) {
assert mWebContentsUrlMapping.first == webContents;
TabCreator tabCreator = mTab.getActivity().getTabCreator(mTab.isIncognito());
assert tabCreator != null;
// Grab the URL, which might not be available via the Tab.
String url = mWebContentsUrlMapping.second;
mWebContentsUrlMapping = null;
// Skip opening a new Tab if it doesn't make sense.
if (mTab.isClosing())
return false;
// Creating new Tabs asynchronously requires starting a new Activity to create the Tab,
// so the Tab returned will always be null. There's no way to know synchronously
// whether the Tab is created, so assume it's always successful.
boolean createdSuccessfully = tabCreator.createTabWithWebContents(mTab, webContents, mTab.getId(), TabLaunchType.FROM_LONGPRESS_FOREGROUND, url);
boolean success = tabCreator.createsTabsAsynchronously() || createdSuccessfully;
if (success && disposition == WindowOpenDisposition.NEW_POPUP) {
PolicyAuditor auditor = ((ChromeApplication) mTab.getApplicationContext()).getPolicyAuditor();
auditor.notifyAuditEvent(mTab.getApplicationContext(), AuditEvent.OPEN_POPUP_URL_SUCCESS, url, "");
}
return success;
}
use of org.chromium.chrome.browser.policy.PolicyAuditor in project AndroidChromium by JackyAndroid.
the class TabWebContentsObserver method didFinishLoad.
@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, "");
}
Aggregations