| 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..80aa1606d7cc257a501d24ae82faeef177197efb
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupConfiguration.java
|
| @@ -0,0 +1,46 @@
|
| +// 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 StartupCallback {
|
| + void run(int startupResult);
|
| + }
|
| +
|
| + private static boolean sBrowserMayStartAsynchronously = false;
|
| + private static StartupCallback sBrowserStartupCompleteCallback = null;
|
| +
|
| + @CalledByNative
|
| + private static boolean browserMayStartAsynchonously() {
|
| + return sBrowserMayStartAsynchronously;
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static void browserStartupComplete(int result) {
|
| + if(sBrowserStartupCompleteCallback != null) {
|
| + sBrowserStartupCompleteCallback.run(result);
|
| + }
|
| + }
|
| +
|
| + /**
|
| + * Set up how startup is run
|
| + * @param browserMayStartAsynchonously Browser initialization may not complete within the call
|
| + * to contentMain.start(). If it doesn't then it 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 set(boolean browserMayStartAsynchonously,
|
| + StartupCallback browserStartupCompleteCallback) {
|
| + sBrowserMayStartAsynchronously = browserMayStartAsynchonously;
|
| + sBrowserStartupCompleteCallback = browserStartupCompleteCallback;
|
| + }
|
| +}
|
|
|