OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.app; | 5 package org.chromium.content.app; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
| 9 import org.chromium.base.ContextUtils; |
9 import org.chromium.base.annotations.JNINamespace; | 10 import org.chromium.base.annotations.JNINamespace; |
10 | 11 |
11 /** | 12 /** |
12 * This class is used to initialize all types of process. It corresponds to | 13 * This class is used to initialize all types of process. It corresponds to |
13 * content/public/app/content_main.h which is not used in Android as it has | 14 * content/public/app/content_main.h which is not used in Android as it has |
14 * the different initialization process. | 15 * the different initialization process. |
15 * | 16 * |
16 * TODO(michaelbai): Refactorying the BrowserProcessMain.java and the | 17 * TODO(michaelbai): Refactorying the BrowserProcessMain.java and the |
17 * ChildProcessService.java to start ContentMain, and run the process | 18 * ChildProcessService.java to start ContentMain, and run the process |
18 * specific initialization code in ContentMainRunner::Initialize. | 19 * specific initialization code in ContentMainRunner::Initialize. |
19 * | 20 * |
20 **/ | 21 **/ |
21 @JNINamespace("content") | 22 @JNINamespace("content") |
22 public class ContentMain { | 23 public class ContentMain { |
23 /** | 24 /** |
24 * Initialize application context in native side. | 25 * Initialize global application context. |
25 **/ | 26 **/ |
26 public static void initApplicationContext(Context context) { | 27 public static void initApplicationContext(Context context) { |
27 nativeInitApplicationContext(context); | 28 ContextUtils.initApplicationContext(context); |
28 } | 29 } |
29 | 30 |
30 /** | 31 /** |
31 * Start the ContentMainRunner in native side. | 32 * Start the ContentMainRunner in native side. |
32 **/ | 33 **/ |
33 public static int start() { | 34 public static int start() { |
34 return nativeStart(); | 35 return nativeStart(); |
35 } | 36 } |
36 | 37 |
37 private static native void nativeInitApplicationContext(Context context); | |
38 private static native int nativeStart(); | 38 private static native int nativeStart(); |
39 } | 39 } |
OLD | NEW |