| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chromium_linker_test_apk; | 5 package org.chromium.chromecast.shell; |
| 6 | |
| 7 import android.app.Application; | |
| 8 | 6 |
| 9 import org.chromium.base.PathUtils; | 7 import org.chromium.base.PathUtils; |
| 8 import org.chromium.content.app.ContentApplication; |
| 10 import org.chromium.content.browser.ResourceExtractor; | 9 import org.chromium.content.browser.ResourceExtractor; |
| 11 | 10 |
| 12 /** | 11 /** |
| 13 * Application for testing the Chromium Linker | 12 * Entry point for the Android cast shell application. Handles initialization o
f information that |
| 13 * needs to be shared across the main activity and the child services created. |
| 14 * |
| 15 * Note that this gets run for each process, including sandboxed child render pr
ocesses. Child |
| 16 * processes don't need most of the full "setup" performed in CastBrowserHelper.
java, but they do |
| 17 * require a few basic pieces (found here). |
| 14 */ | 18 */ |
| 15 public class ChromiumLinkerTestApplication extends Application { | 19 public class CastApplication extends ContentApplication { |
| 16 | 20 |
| 17 /** | 21 private static final String[] MANDATORY_PAK_FILES = new String[] {"cast_shel
l.pak"}; |
| 18 * icudtl.dat provides ICU (i18n library) with all the data for its | 22 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "cast_shell"; |
| 19 * operation. We use to link it statically to our binary, but not any more | |
| 20 * so that we have to install it along with other mandatory pak files. | |
| 21 * See src/third_party/icu/README.chromium. | |
| 22 */ | |
| 23 private static final String[] MANDATORY_PAK_FILES = new String[] { | |
| 24 "content_shell.pak", | |
| 25 "icudtl.dat" | |
| 26 }; | |
| 27 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "chromium_linker
_test"; | |
| 28 | 23 |
| 29 @Override | 24 @Override |
| 30 public void onCreate() { | 25 public void onCreate() { |
| 31 super.onCreate(); | 26 super.onCreate(); |
| 32 initializeApplicationParameters(); | 27 initializeApplicationParameters(); |
| 33 } | 28 } |
| 34 | 29 |
| 35 public static void initializeApplicationParameters() { | 30 public static void initializeApplicationParameters() { |
| 36 ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAK_FILES); | 31 ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAK_FILES); |
| 37 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 32 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
| 38 } | 33 } |
| 39 | 34 |
| 40 } | 35 } |
| OLD | NEW |