1 // Copyright (c) 2012 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 "chrome/app/android/chrome_jni_onload.h"
7 #include "base/android/library_loader/library_loader_hooks.h"
9 #include "chrome/app/android/chrome_android_initializer.h"
10 #include "chrome/browser/android/chrome_jni_registrar.h"
11 #include "content/public/app/content_jni_onload.h"
18 bool RegisterJNI(JNIEnv
* env
) {
19 if (base::android::GetLibraryProcessType(env
) ==
20 base::android::PROCESS_BROWSER
) {
21 return RegisterBrowserJNI(env
);
32 bool OnJNIOnLoadRegisterJNI(
34 base::android::RegisterCallback callback
) {
35 std::vector
<base::android::RegisterCallback
> register_callbacks
;
36 register_callbacks
.push_back(callback
);
37 register_callbacks
.push_back(base::Bind(&RegisterJNI
));
38 return content::android::OnJNIOnLoadRegisterJNI(vm
, register_callbacks
);
41 bool OnJNIOnLoadInit(base::android::InitCallback callback
) {
42 std::vector
<base::android::InitCallback
> init_callbacks
;
43 init_callbacks
.push_back(callback
);
44 init_callbacks
.push_back(base::Bind(&Init
));
45 return content::android::OnJNIOnLoadInit(init_callbacks
);
48 } // namespace android