本文整理汇总了Java中org.chromium.content.app.ContentApplication类的典型用法代码示例。如果您正苦于以下问题:Java ContentApplication类的具体用法?Java ContentApplication怎么用?Java ContentApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentApplication类属于org.chromium.content.app包,在下文中一共展示了ContentApplication类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: preInflationStartup
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
private void preInflationStartup() {
ThreadUtils.assertOnUiThread();
if (mPreInflationStartupComplete) return;
PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
// Ensure critical files are available, so they aren't blocked on the file-system
// behind long-running accesses in next phase.
// Don't do any large file access here!
ContentApplication.initCommandLine(mApplication);
waitForDebuggerIfNeeded();
ChromeStrictMode.configureStrictMode();
ChromeWebApkHost.init();
warmUpSharedPrefs();
DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication);
ApplicationStatus.registerStateListenerForAllActivities(
createActivityStateListener());
mPreInflationStartupComplete = true;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:ChromeBrowserInitializer.java
示例2: onCreate
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
@Override
public boolean onCreate() {
ContentApplication.initCommandLine(getContext());
BrowserStartupController.get(getContext(), LibraryProcessType.PROCESS_BROWSER)
.addStartupCompletedObserver(
new BrowserStartupController.StartupCallback() {
@Override
public void onSuccess(boolean alreadyStarted) {
ensureNativeSideInitialized();
}
@Override
public void onFailure() {
}
});
return true;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:ChromeBrowserProvider.java
示例3: enableFullscreenFlags
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
/**
* Enable fullscreen related startup flags.
* @param resources Resources to use while calculating initialization constants.
* @param resControlContainerHeight The resource id for the height of the browser controls.
*/
public static void enableFullscreenFlags(
Resources resources, Context context, int resControlContainerHeight) {
ContentApplication.initCommandLine(context);
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;
TypedValue threshold = new TypedValue();
resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
Log.w("renshuai: ", "hello" + threshold.coerceToString().toString());
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:ApplicationInitialization.java
示例4: preInflationStartup
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
private void preInflationStartup() {
ThreadUtils.assertOnUiThread();
if (mPreInflationStartupComplete) return;
// Ensure critical files are available, so they aren't blocked on the file-system
// behind long-running accesses in next phase.
// Don't do any large file access here!
ContentApplication.initCommandLine(mApplication);
waitForDebuggerIfNeeded();
configureStrictMode();
// Warm up the shared prefs stored.
PreferenceManager.getDefaultSharedPreferences(mApplication);
DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication);
mPreInflationStartupComplete = true;
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:19,代码来源:ChromeBrowserInitializer.java
示例5: onCreate
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
@Override
public boolean onCreate() {
ContentApplication.initCommandLine(getContext());
BrowserStartupController.get(getContext(), LibraryProcessType.PROCESS_BROWSER)
.addStartupCompletedObserver(
new BrowserStartupController.StartupCallback() {
@Override
public void onSuccess(boolean alreadyStarted) {
ensureNativeSideInitialized();
}
@Override
public void onFailure() {
}
});
// Pre-load shared preferences object, this happens on a separate thread
PreferenceManager.getDefaultSharedPreferences(getContext());
return true;
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:22,代码来源:ChromeBrowserProvider.java
示例6: enableFullscreenFlags
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
/**
* Enable fullscreen related startup flags.
* @param resources Resources to use while calculating initialization constants.
* @param resControlContainerHeight The resource id for the height of the top controls.
*/
public static void enableFullscreenFlags(
Resources resources, Context context, int resControlContainerHeight) {
ContentApplication.initCommandLine(context);
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;
TypedValue threshold = new TypedValue();
resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:21,代码来源:ApplicationInitialization.java
示例7: onCreate
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
@Override
public boolean onCreate() {
// Work around for broken Android versions that break the Android contract and initialize
// ContentProviders on non-UI threads. crbug.com/705442
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
ContentApplication.initCommandLine(getContext());
BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER)
.addStartupCompletedObserver(
new BrowserStartupController.StartupCallback() {
@Override
public void onSuccess(boolean alreadyStarted) {
ensureNativeSideInitialized();
}
@Override
public void onFailure() {
}
});
}
});
return true;
}
开发者ID:mogoweb,项目名称:365browser,代码行数:27,代码来源:ChromeBrowserProvider.java
示例8: enableFullscreenFlags
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
/**
* Enable fullscreen related startup flags.
* @param resources Resources to use while calculating initialization constants.
* @param resControlContainerHeight The resource id for the height of the browser controls.
*/
public static void enableFullscreenFlags(
Resources resources, Context context, int resControlContainerHeight) {
ContentApplication.initCommandLine(context);
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;
TypedValue threshold = new TypedValue();
resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
开发者ID:mogoweb,项目名称:365browser,代码行数:21,代码来源:ApplicationInitialization.java
示例9: dispatchIntentOnUIThread
import org.chromium.content.app.ContentApplication; //导入依赖的package包/类
/**
* Initializes Chrome and starts the browser process if it's not running as of yet, and
* dispatch |intent| to the NotificationUIManager once this is done.
*
* @param intent The intent containing the notification's information.
*/
@SuppressFBWarnings("DM_EXIT")
private void dispatchIntentOnUIThread(Intent intent) {
Context context = getApplicationContext();
if (!CommandLine.isInitialized()) {
ContentApplication.initCommandLine(context);
}
try {
BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER)
.startBrowserProcessesSync(false);
// Now that the browser process is initialized, we pass forward the call to the
// Notification UI Manager which will take care of delivering the appropriate events.
if (!NotificationUIManager.dispatchNotificationEvent(intent)) {
Log.w(TAG, "Unable to dispatch the notification event to Chrome.");
}
// TODO(peter): Verify that the lifetime of the NotificationService is sufficient
// when a notification event could be dispatched successfully.
// TODO(peter): The native side needs to tell us when executing the event has
// finished, so that we can forcefully stop the service.
} catch (ProcessInitException e) {
Log.e(TAG, "Unable to start the browser process.", e);
System.exit(-1);
}
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:35,代码来源:NotificationService.java
注:本文中的org.chromium.content.app.ContentApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论