1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/android/browser_startup_controller.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "content/browser/android/content_startup_flags.h"
11 #include "jni/BrowserStartupController_jni.h"
15 bool BrowserMayStartAsynchronously() {
16 JNIEnv
* env
= base::android::AttachCurrentThread();
17 return Java_BrowserStartupController_browserMayStartAsynchonously(env
);
20 void BrowserStartupComplete(int result
) {
21 JNIEnv
* env
= base::android::AttachCurrentThread();
22 Java_BrowserStartupController_browserStartupComplete(env
, result
);
25 bool RegisterBrowserStartupController(JNIEnv
* env
) {
26 return RegisterNativesImpl(env
);
29 static void SetCommandLineFlags(
31 const JavaParamRef
<jclass
>& clazz
,
32 jboolean single_process
,
33 const JavaParamRef
<jstring
>& plugin_descriptor
) {
34 std::string plugin_str
=
35 (plugin_descriptor
== NULL
37 : base::android::ConvertJavaStringToUTF8(env
, plugin_descriptor
));
38 SetContentCommandLineFlags(static_cast<bool>(single_process
), plugin_str
);
41 static jboolean
IsOfficialBuild(JNIEnv
* env
,
42 const JavaParamRef
<jclass
>& clazz
) {
43 #if defined(OFFICIAL_BUILD)
50 static jboolean
IsPluginEnabled(JNIEnv
* env
,
51 const JavaParamRef
<jclass
>& clazz
) {
52 #if defined(ENABLE_PLUGINS)
59 } // namespace content