Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / app / android / content_jni_onload.cc
blob67a596d4cec35cf90e88bcc29f4ee739a853db47
1 // Copyright 2015 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/public/app/content_jni_onload.h"
7 #include <vector>
9 #include "base/android/base_jni_onload.h"
10 #include "base/android/library_loader/library_loader_hooks.h"
11 #include "base/bind.h"
12 #include "content/app/android/library_loader_hooks.h"
13 #include "content/public/app/content_main.h"
15 namespace content {
16 namespace android {
18 namespace {
20 bool RegisterJNI(JNIEnv* env) {
21 return content::EnsureJniRegistered(env);
24 bool Init() {
25 base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
26 return true;
29 } // namespace
32 bool OnJNIOnLoadRegisterJNI(
33 JavaVM* vm,
34 std::vector<base::android::RegisterCallback> callbacks) {
35 callbacks.push_back(base::Bind(&RegisterJNI));
36 return base::android::OnJNIOnLoadRegisterJNI(vm, callbacks);
39 bool OnJNIOnLoadInit(
40 std::vector<base::android::InitCallback> callbacks) {
41 callbacks.push_back(base::Bind(&Init));
42 return base::android::OnJNIOnLoadInit(callbacks);
45 } // namespace android
46 } // namespace content