Refactor ProtectedMediaIdentifierPermissionContext to derive from PermissionContextBase.
[chromium-blink-merge.git] / chrome / app / android / chrome_android_initializer.cc
blobe4d0c2d4307c2cd9993c85aeb30b395cc524b6df
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_android_initializer.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/library_loader/library_loader_hooks.h"
9 #include "base/logging.h"
10 #include "chrome/app/android/chrome_main_delegate_android.h"
11 #include "chrome/common/chrome_version_info.h"
12 #include "content/public/app/android_library_loader_hooks.h"
13 #include "content/public/app/content_main.h"
15 jint RunChrome(JavaVM* vm, ChromeMainDelegateAndroid* main_delegate) {
16 base::android::InitVM(vm);
17 JNIEnv* env = base::android::AttachCurrentThread();
18 if (!base::android::RegisterLibraryLoaderEntryHook(env))
19 return -1;
21 // Pass the library version number to content so that we can check it from the
22 // Java side before continuing initialization
23 chrome::VersionInfo vi;
24 base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
25 base::android::SetVersionNumber(vi.Version().c_str());
27 DCHECK(main_delegate);
28 content::SetContentMainDelegate(main_delegate);
30 return JNI_VERSION_1_4;