sandbox/linux/bpf_dsl: eliminate implicit dependency on C++ compiler behavior
[chromium-blink-merge.git] / content / browser / android / browser_startup_controller.cc
blob124b519046f1f9a2416f10fa95a2742a80fcd033
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"
13 namespace content {
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(
30 JNIEnv* env,
31 const JavaParamRef<jclass>& clazz,
32 jboolean single_process,
33 const JavaParamRef<jstring>& plugin_descriptor) {
34 std::string plugin_str =
35 (plugin_descriptor == NULL
36 ? std::string()
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)
44 return true;
45 #else
46 return false;
47 #endif
50 static jboolean IsPluginEnabled(JNIEnv* env,
51 const JavaParamRef<jclass>& clazz) {
52 #if defined(ENABLE_PLUGINS)
53 return true;
54 #else
55 return false;
56 #endif
59 } // namespace content