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_shell_apk; | 5 package org.chromium.content_shell_apk; |
6 | 6 |
7 import android.content.Context; | |
8 | |
9 import org.chromium.base.CommandLine; | 7 import org.chromium.base.CommandLine; |
10 import org.chromium.base.ContextUtils; | 8 import org.chromium.base.ContextUtils; |
11 import org.chromium.base.PathUtils; | 9 import org.chromium.base.PathUtils; |
12 import org.chromium.base.annotations.SuppressFBWarnings; | 10 import org.chromium.base.annotations.SuppressFBWarnings; |
13 import org.chromium.content.app.ContentApplication; | 11 import org.chromium.content.app.ContentApplication; |
14 | 12 |
15 /** | 13 /** |
16 * Entry point for the content shell application. Handles initialization of inf
ormation that needs | 14 * Entry point for the content shell application. Handles initialization of inf
ormation that needs |
17 * to be shared across the main activity and the child services created. | 15 * to be shared across the main activity and the child services created. |
18 */ | 16 */ |
19 public class ContentShellApplication extends ContentApplication { | 17 public class ContentShellApplication extends ContentApplication { |
20 | 18 |
21 public static final String COMMAND_LINE_FILE = "/data/local/tmp/content-shel
l-command-line"; | 19 public static final String COMMAND_LINE_FILE = "/data/local/tmp/content-shel
l-command-line"; |
22 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content_shell"; | 20 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content_shell"; |
23 | 21 |
24 @Override | 22 public ContentShellApplication() { |
25 protected void attachBaseContext(Context base) { | 23 super(); |
26 super.attachBaseContext(base); | |
27 ContextUtils.initApplicationContext(this); | 24 ContextUtils.initApplicationContext(this); |
28 } | 25 } |
29 | 26 |
30 @Override | 27 @Override |
31 public void onCreate() { | 28 public void onCreate() { |
32 super.onCreate(); | 29 super.onCreate(); |
33 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 30 } |
| 31 |
| 32 @Override |
| 33 protected void initializeLibraryDependencies() { |
| 34 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, t
his); |
34 } | 35 } |
35 | 36 |
36 @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") | 37 @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") |
37 @Override | 38 @Override |
38 public void initCommandLine() { | 39 public void initCommandLine() { |
39 if (!CommandLine.isInitialized()) { | 40 if (!CommandLine.isInitialized()) { |
40 CommandLine.initFromFile(COMMAND_LINE_FILE); | 41 CommandLine.initFromFile(COMMAND_LINE_FILE); |
41 } | 42 } |
42 } | 43 } |
43 | 44 |
44 } | 45 } |
OLD | NEW |