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

Side by Side Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java

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

Powered by Google App Engine
This is Rietveld 408576698