This source file includes following definitions.
- onCreate
- sendBroadcast
- addObserver
- removeObserver
- initCommandLine
- openProtectedContentSettings
- showSyncSettings
- showTermsOfServiceDialog
- areParentalControlsEnabled
- getPKCS11AuthenticationManager
package org.chromium.chrome.shell;
import android.content.Intent;
import org.chromium.base.CommandLine;
import org.chromium.base.PathUtils;
import org.chromium.chrome.browser.ChromiumApplication;
import org.chromium.chrome.browser.PKCS11AuthenticationManager;
import org.chromium.chrome.browser.UmaUtils;
import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGenerator;
import org.chromium.content.browser.ResourceExtractor;
import java.util.ArrayList;
public class ChromeShellApplication extends ChromiumApplication {
private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "chromeshell";
private static final String[] CHROME_MANDATORY_PAKS = {
"en-US.pak",
"resources.pak",
"chrome_100_percent.pak",
"icudtl.dat",
};
private static final String COMMAND_LINE_FILE = "/data/local/tmp/chrome-shell-command-line";
ArrayList<ChromeShellApplicationObserver> mObservers;
@Override
public void onCreate() {
UmaUtils.recordMainEntryPointTime();
super.onCreate();
ResourceExtractor.setMandatoryPaksToExtract(CHROME_MANDATORY_PAKS);
PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
mObservers = new ArrayList<ChromeShellApplicationObserver>();
UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator(this);
}
@Override
public void sendBroadcast(Intent intent) {
boolean shouldFire = true;
for (ChromeShellApplicationObserver observer : mObservers) {
shouldFire &= observer.onSendBroadcast(intent);
}
if (shouldFire) super.sendBroadcast(intent);
}
public void addObserver(ChromeShellApplicationObserver observer) {
mObservers.add(observer);
}
public void removeObserver(ChromeShellApplicationObserver observer) {
mObservers.remove(observer);
}
public static void initCommandLine() {
if (!CommandLine.isInitialized()) {
CommandLine.initFromFile(COMMAND_LINE_FILE);
}
}
@Override
protected void openProtectedContentSettings() {
}
@Override
protected void showSyncSettings() {
}
@Override
protected void showTermsOfServiceDialog() {
}
@Override
protected boolean areParentalControlsEnabled() {
return false;
}
@Override
protected PKCS11AuthenticationManager getPKCS11AuthenticationManager() {
return new ChromeShellPKCS11AuthenticationManager();
}
}