OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.content.SharedPreferences; | 9 import android.content.SharedPreferences; |
10 import android.os.Bundle; | 10 import android.os.Bundle; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 private static final String TAG = "ChromiumApplication"; | 86 private static final String TAG = "ChromiumApplication"; |
87 private static final String PREF_BOOT_TIMESTAMP = | 87 private static final String PREF_BOOT_TIMESTAMP = |
88 "com.google.android.apps.chrome.ChromeMobileApplication.BOOT_TIMESTA
MP"; | 88 "com.google.android.apps.chrome.ChromeMobileApplication.BOOT_TIMESTA
MP"; |
89 private static final long BOOT_TIMESTAMP_MARGIN_MS = 1000; | 89 private static final long BOOT_TIMESTAMP_MARGIN_MS = 1000; |
90 | 90 |
91 private static DocumentTabModelSelector sDocumentTabModelSelector; | 91 private static DocumentTabModelSelector sDocumentTabModelSelector; |
92 | 92 |
93 private PrintingController mPrintingController; | 93 private PrintingController mPrintingController; |
94 | 94 |
| 95 public ChromeApplication() { |
| 96 super(); |
| 97 ContextUtils.initApplicationContext(this); |
| 98 } |
| 99 |
95 /** | 100 /** |
96 * This is called during early initialization in order to set up ChildProces
sLauncher | 101 * This is called during early initialization in order to set up ChildProces
sLauncher |
97 * for certain Chrome packaging configurations | 102 * for certain Chrome packaging configurations |
98 */ | 103 */ |
99 public ChildProcessCreationParams getChildProcessCreationParams() { | 104 public ChildProcessCreationParams getChildProcessCreationParams() { |
100 return null; | 105 return null; |
101 } | 106 } |
102 | 107 |
103 /** | 108 /** |
104 * This is called once per ChromeApplication instance, which get created per
process | 109 * This is called once per ChromeApplication instance, which get created per
process |
105 * (browser OR renderer). Don't stick anything in here that shouldn't be ca
lled multiple times | 110 * (browser OR renderer). Don't stick anything in here that shouldn't be ca
lled multiple times |
106 * during Chrome's lifetime. | 111 * during Chrome's lifetime. |
107 */ | 112 */ |
108 @Override | 113 @Override |
109 public void onCreate() { | 114 public void onCreate() { |
110 UmaUtils.recordMainEntryPointTime(); | 115 UmaUtils.recordMainEntryPointTime(); |
111 initCommandLine(); | 116 initCommandLine(); |
112 TraceEvent.maybeEnableEarlyTracing(); | 117 TraceEvent.maybeEnableEarlyTracing(); |
113 TraceEvent.begin("ChromeApplication.onCreate"); | 118 TraceEvent.begin("ChromeApplication.onCreate"); |
114 | 119 |
115 super.onCreate(); | 120 super.onCreate(); |
116 ContextUtils.initApplicationContext(this); | |
117 | 121 |
118 TraceEvent.end("ChromeApplication.onCreate"); | 122 TraceEvent.end("ChromeApplication.onCreate"); |
119 } | 123 } |
120 | 124 |
121 /** | 125 /** |
122 * Returns a new instance of VariationsSession. | 126 * Returns a new instance of VariationsSession. |
123 */ | 127 */ |
124 public VariationsSession createVariationsSession() { | 128 public VariationsSession createVariationsSession() { |
125 return new VariationsSession(); | 129 return new VariationsSession(); |
126 } | 130 } |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 483 } |
480 | 484 |
481 /** | 485 /** |
482 * Creates a new {@link AccountManagerDelegate}. | 486 * Creates a new {@link AccountManagerDelegate}. |
483 * @return the created {@link AccountManagerDelegate}. | 487 * @return the created {@link AccountManagerDelegate}. |
484 */ | 488 */ |
485 public AccountManagerDelegate createAccountManagerDelegate() { | 489 public AccountManagerDelegate createAccountManagerDelegate() { |
486 return new SystemAccountManagerDelegate(this); | 490 return new SystemAccountManagerDelegate(this); |
487 } | 491 } |
488 } | 492 } |
OLD | NEW |