use of org.chromium.chrome.browser.ChromeApplication in project AndroidChromium by JackyAndroid.
the class ChildAccountFeedbackReporter method reportFeedback.
public static void reportFeedback(Activity activity, final String description, String url) {
ThreadUtils.assertOnUiThread();
if (sFeedbackReporter == null) {
ChromeApplication application = (ChromeApplication) activity.getApplication();
sFeedbackReporter = application.createFeedbackReporter();
}
FeedbackCollector.create(activity, Profile.getLastUsedProfile(), url, new FeedbackCollector.FeedbackResult() {
@Override
public void onResult(FeedbackCollector collector) {
collector.setDescription(description);
sFeedbackReporter.reportFeedback(collector);
}
});
}
use of org.chromium.chrome.browser.ChromeApplication in project AndroidChromium by JackyAndroid.
the class AccountManagementFragment method configureGoogleActivityControls.
private void configureGoogleActivityControls() {
Preference pref = findPreference(PREF_GOOGLE_ACTIVITY_CONTROLS);
pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Activity activity = getActivity();
((ChromeApplication) (activity.getApplicationContext())).createGoogleActivityController().openWebAndAppActivitySettings(activity, ChromeSigninController.get(activity).getSignedInAccountName());
RecordUserAction.record("Signin_AccountSettings_GoogleActivityControlsClicked");
return true;
}
});
}
use of org.chromium.chrome.browser.ChromeApplication 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.ChromeApplication 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.ChromeApplication in project AndroidChromium by JackyAndroid.
the class ProcessInitializationHandler method handleDeferredStartupTasksInitialization.
/**
* Performs the deferred startup task initialization.
*/
protected void handleDeferredStartupTasksInitialization() {
final ChromeApplication application = (ChromeApplication) ContextUtils.getApplicationContext();
DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() {
@Override
public void run() {
ForcedSigninProcessor.start(application);
AccountsChangedReceiver.addObserver(new AccountsChangedReceiver.AccountsChangedObserver() {
@Override
public void onAccountsChanged(Context context, Intent intent) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
ForcedSigninProcessor.start(application);
}
});
}
});
}
});
DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() {
@Override
public void run() {
GoogleServicesManager.get(application).onMainActivityStart();
RevenueStats.getInstance();
}
});
DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() {
@Override
public void run() {
mDevToolsServer = new DevToolsServer(DEV_TOOLS_SERVER_SOCKET_PREFIX);
mDevToolsServer.setRemoteDebuggingEnabled(true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION);
}
});
DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() {
@Override
public void run() {
// is fixed.
assert !CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE);
if (!CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE)) {
DownloadController.setDownloadNotificationService(DownloadManagerService.getDownloadManagerService(application));
}
if (ApiCompatibilityUtils.isPrintingSupported()) {
String errorText = application.getResources().getString(R.string.error_printing_failed);
PrintingControllerImpl.create(new PrintDocumentAdapterWrapper(), errorText);
}
}
});
}
Aggregations