use of org.chromium.printing.PrintDocumentAdapterWrapper 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