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; |
11 import android.os.Handler; | 11 import android.os.Handler; |
12 import android.os.Looper; | 12 import android.os.Looper; |
13 import android.os.SystemClock; | 13 import android.os.SystemClock; |
14 import android.util.Log; | 14 import android.util.Log; |
15 | 15 |
16 import org.chromium.base.ActivityState; | 16 import org.chromium.base.ActivityState; |
17 import org.chromium.base.ApiCompatibilityUtils; | 17 import org.chromium.base.ApiCompatibilityUtils; |
18 import org.chromium.base.ApplicationStatus; | 18 import org.chromium.base.ApplicationStatus; |
19 import org.chromium.base.CommandLineInitUtil; | 19 import org.chromium.base.CommandLineInitUtil; |
20 import org.chromium.base.ContextUtils; | 20 import org.chromium.base.ContextUtils; |
21 import org.chromium.base.ResourceExtractor; | |
22 import org.chromium.base.ThreadUtils; | 21 import org.chromium.base.ThreadUtils; |
23 import org.chromium.base.TraceEvent; | 22 import org.chromium.base.TraceEvent; |
24 import org.chromium.base.annotations.CalledByNative; | 23 import org.chromium.base.annotations.CalledByNative; |
25 import org.chromium.base.annotations.SuppressFBWarnings; | 24 import org.chromium.base.annotations.SuppressFBWarnings; |
26 import org.chromium.base.library_loader.ProcessInitException; | 25 import org.chromium.base.library_loader.ProcessInitException; |
27 import org.chromium.chrome.R; | |
28 import org.chromium.chrome.browser.banners.AppDetailsDelegate; | 26 import org.chromium.chrome.browser.banners.AppDetailsDelegate; |
29 import org.chromium.chrome.browser.customtabs.CustomTabsConnection; | 27 import org.chromium.chrome.browser.customtabs.CustomTabsConnection; |
30 import org.chromium.chrome.browser.datausage.ExternalDataUseObserver; | 28 import org.chromium.chrome.browser.datausage.ExternalDataUseObserver; |
31 import org.chromium.chrome.browser.document.DocumentActivity; | 29 import org.chromium.chrome.browser.document.DocumentActivity; |
32 import org.chromium.chrome.browser.document.IncognitoDocumentActivity; | 30 import org.chromium.chrome.browser.document.IncognitoDocumentActivity; |
33 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; | 31 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; |
34 import org.chromium.chrome.browser.feedback.EmptyFeedbackReporter; | 32 import org.chromium.chrome.browser.feedback.EmptyFeedbackReporter; |
35 import org.chromium.chrome.browser.feedback.FeedbackReporter; | 33 import org.chromium.chrome.browser.feedback.FeedbackReporter; |
36 import org.chromium.chrome.browser.gsa.GSAHelper; | 34 import org.chromium.chrome.browser.gsa.GSAHelper; |
37 import org.chromium.chrome.browser.help.HelpAndFeedback; | 35 import org.chromium.chrome.browser.help.HelpAndFeedback; |
(...skipping 29 matching lines...) Expand all Loading... | |
67 import org.chromium.chrome.browser.tabmodel.document.TabDelegate; | 65 import org.chromium.chrome.browser.tabmodel.document.TabDelegate; |
68 import org.chromium.components.signin.AccountManagerDelegate; | 66 import org.chromium.components.signin.AccountManagerDelegate; |
69 import org.chromium.components.signin.SystemAccountManagerDelegate; | 67 import org.chromium.components.signin.SystemAccountManagerDelegate; |
70 import org.chromium.content.app.ContentApplication; | 68 import org.chromium.content.app.ContentApplication; |
71 import org.chromium.content.browser.ChildProcessCreationParams; | 69 import org.chromium.content.browser.ChildProcessCreationParams; |
72 import org.chromium.policy.AppRestrictionsProvider; | 70 import org.chromium.policy.AppRestrictionsProvider; |
73 import org.chromium.policy.CombinedPolicyProvider; | 71 import org.chromium.policy.CombinedPolicyProvider; |
74 import org.chromium.policy.CombinedPolicyProvider.PolicyChangeListener; | 72 import org.chromium.policy.CombinedPolicyProvider.PolicyChangeListener; |
75 import org.chromium.printing.PrintingController; | 73 import org.chromium.printing.PrintingController; |
76 import org.chromium.ui.base.ActivityWindowAndroid; | 74 import org.chromium.ui.base.ActivityWindowAndroid; |
77 import org.chromium.ui.base.ResourceBundle; | |
78 | 75 |
79 /** | 76 /** |
80 * Basic application functionality that should be shared among all browser appli cations that use | 77 * Basic application functionality that should be shared among all browser appli cations that use |
81 * chrome layer. | 78 * chrome layer. |
82 */ | 79 */ |
83 public class ChromeApplication extends ContentApplication { | 80 public class ChromeApplication extends ContentApplication { |
84 public static final String COMMAND_LINE_FILE = "chrome-command-line"; | 81 public static final String COMMAND_LINE_FILE = "chrome-command-line"; |
85 | 82 |
86 private static final String TAG = "ChromiumApplication"; | 83 private static final String TAG = "ChromiumApplication"; |
87 private static final String PREF_BOOT_TIMESTAMP = | 84 private static final String PREF_BOOT_TIMESTAMP = |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 */ | 168 */ |
172 protected void showSingleOriginSettings(String url) { | 169 protected void showSingleOriginSettings(String url) { |
173 Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite (url); | 170 Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite (url); |
174 Intent intent = PreferencesLauncher.createIntentForSettingsPage( | 171 Intent intent = PreferencesLauncher.createIntentForSettingsPage( |
175 this, SingleWebsitePreferences.class.getName()); | 172 this, SingleWebsitePreferences.class.getName()); |
176 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs) ; | 173 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs) ; |
177 startActivity(intent); | 174 startActivity(intent); |
178 } | 175 } |
179 | 176 |
180 @Override | 177 @Override |
181 protected void initializeLibraryDependencies() { | |
Ted C
2016/09/30 17:03:15
Oooohh...can we remove this method from ContentApp
agrieve
2016/10/03 20:10:17
Done \o/
| |
182 // The ResourceExtractor is only needed by the browser process, but this will have no | |
183 // impact on the renderer process construction. | |
184 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); | |
185 ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleRe sources()); | |
186 } | |
187 | |
188 @Override | |
189 public void initCommandLine() { | 178 public void initCommandLine() { |
190 CommandLineInitUtil.initCommandLine(this, COMMAND_LINE_FILE); | 179 CommandLineInitUtil.initCommandLine(this, COMMAND_LINE_FILE); |
191 } | 180 } |
192 | 181 |
193 /** | 182 /** |
194 * Shows an error dialog following a startup error, and then exits the appli cation. | 183 * Shows an error dialog following a startup error, and then exits the appli cation. |
195 * @param e The exception reported by Chrome initialization. | 184 * @param e The exception reported by Chrome initialization. |
196 */ | 185 */ |
197 public static void reportStartupErrorAndExit(final ProcessInitException e) { | 186 public static void reportStartupErrorAndExit(final ProcessInitException e) { |
198 Activity activity = ApplicationStatus.getLastTrackedFocusedActivity(); | 187 Activity activity = ApplicationStatus.getLastTrackedFocusedActivity(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 } | 472 } |
484 | 473 |
485 /** | 474 /** |
486 * Creates a new {@link AccountManagerDelegate}. | 475 * Creates a new {@link AccountManagerDelegate}. |
487 * @return the created {@link AccountManagerDelegate}. | 476 * @return the created {@link AccountManagerDelegate}. |
488 */ | 477 */ |
489 public AccountManagerDelegate createAccountManagerDelegate() { | 478 public AccountManagerDelegate createAccountManagerDelegate() { |
490 return new SystemAccountManagerDelegate(this); | 479 return new SystemAccountManagerDelegate(this); |
491 } | 480 } |
492 } | 481 } |
OLD | NEW |