Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: content/shell/android/shell_library_loader.cc

Issue 10035034: Implement the skeleton of an android content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed drawable png as it was checked in separately. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "base/basictypes.h"
6 #include "base/android/jni_android.h"
7 #include "base/android/jni_registrar.h"
8 #include "content/public/browser/android_library_loader_hooks.h"
9 #include "content/shell/shell_main_delegate.h"
10 #include "content/shell/android/shell_manager.h"
11 #include "content/shell/android/shell_view.h"
12
13 static base::android::RegistrationMethod kRegistrationMethods[] = {
14 { "ShellManager", content::RegisterShellManager },
15 { "ShellView", content::ShellView::Register },
16 };
17
18 // This is called by the VM when the shared library is first loaded.
19 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
20 base::android::InitVM(vm);
21 JNIEnv* env = base::android::AttachCurrentThread();
22 if (!RegisterLibraryLoaderEntryHook(env)) {
23 return -1;
24 }
25
26 // To be called only from the UI thread. If loading the library is done on
27 // a separate thread, this should be moved elsewhere.
28 if (!base::android::RegisterNativeMethods(env, kRegistrationMethods,
29 arraysize(kRegistrationMethods)))
30 return -1;
31
32 // TODO(tedchoc): Set this to the main delegate once the Android specific
33 // browser process initialization gets checked in.
34 new ShellMainDelegate();
35
36 return JNI_VERSION_1_4;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698