| Index: content/public/android/java/src/org/chromium/content/browser/BrowserStartupConfiguration.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupConfiguration.java b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupConfiguration.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..09f93ed2535c285f02bf8b400f90b32389f8a30a
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupConfiguration.java
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.content.browser;
|
| +
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +/**
|
| + * This class controls how C++ browser startup is run.
|
| + */
|
| +@JNINamespace("content")
|
| +public class BrowserStartupConfiguration {
|
| + public interface Callback {
|
| + void run(int startupResult);
|
| + }
|
| +
|
| + private static boolean sBrowserMayStartAsynchronously = false;
|
| + private static Callback sBrowserStartupCompleteCallback = null;
|
| +
|
| + @CalledByNative
|
| + private static boolean browserMayStartAsynchonously() {
|
| + return sBrowserMayStartAsynchronously;
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static void browserStartupComplete(int result) {
|
| + if(sBrowserStartupCompleteCallback != null) {
|
| + sBrowserStartupCompleteCallback.run(result);
|
| + }
|
| + }
|
| +
|
| + /**
|
| + * Set browser to start asynchronously. May only be called before contentMain.start(). If it
|
| + * has been called then contentMain.start() will queue up a series of UI tasks to complete
|
| + * browser initialization.
|
| + * @param browserStartupCompleteCallback If not null called when browser startup is complete.
|
| + */
|
| + public static void setAsync(Callback browserStartupCompleteCallback) {
|
| + sBrowserMayStartAsynchronously = true;
|
| + sBrowserStartupCompleteCallback = browserStartupCompleteCallback;
|
| + }
|
| +}
|
|
|