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; | 21 import org.chromium.base.ResourceExtractor; |
22 import org.chromium.base.ThreadUtils; | 22 import org.chromium.base.ThreadUtils; |
23 import org.chromium.base.TraceEvent; | 23 import org.chromium.base.TraceEvent; |
24 import org.chromium.base.annotations.CalledByNative; | 24 import org.chromium.base.annotations.CalledByNative; |
25 import org.chromium.base.annotations.SuppressFBWarnings; | 25 import org.chromium.base.annotations.SuppressFBWarnings; |
26 import org.chromium.base.library_loader.ProcessInitException; | 26 import org.chromium.base.library_loader.ProcessInitException; |
27 import org.chromium.chrome.R; | |
28 import org.chromium.chrome.browser.banners.AppDetailsDelegate; | 27 import org.chromium.chrome.browser.banners.AppDetailsDelegate; |
29 import org.chromium.chrome.browser.customtabs.CustomTabsConnection; | 28 import org.chromium.chrome.browser.customtabs.CustomTabsConnection; |
30 import org.chromium.chrome.browser.datausage.ExternalDataUseObserver; | 29 import org.chromium.chrome.browser.datausage.ExternalDataUseObserver; |
31 import org.chromium.chrome.browser.document.DocumentActivity; | 30 import org.chromium.chrome.browser.document.DocumentActivity; |
32 import org.chromium.chrome.browser.document.IncognitoDocumentActivity; | 31 import org.chromium.chrome.browser.document.IncognitoDocumentActivity; |
33 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; | 32 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; |
34 import org.chromium.chrome.browser.feedback.EmptyFeedbackReporter; | 33 import org.chromium.chrome.browser.feedback.EmptyFeedbackReporter; |
35 import org.chromium.chrome.browser.feedback.FeedbackReporter; | 34 import org.chromium.chrome.browser.feedback.FeedbackReporter; |
36 import org.chromium.chrome.browser.gsa.GSAHelper; | 35 import org.chromium.chrome.browser.gsa.GSAHelper; |
37 import org.chromium.chrome.browser.help.HelpAndFeedback; | 36 import org.chromium.chrome.browser.help.HelpAndFeedback; |
(...skipping 28 matching lines...) Expand all Loading... |
66 import org.chromium.chrome.browser.tabmodel.document.StorageDelegate; | 65 import org.chromium.chrome.browser.tabmodel.document.StorageDelegate; |
67 import org.chromium.chrome.browser.tabmodel.document.TabDelegate; | 66 import org.chromium.chrome.browser.tabmodel.document.TabDelegate; |
68 import org.chromium.components.sync.signin.AccountManagerDelegate; | 67 import org.chromium.components.sync.signin.AccountManagerDelegate; |
69 import org.chromium.components.sync.signin.SystemAccountManagerDelegate; | 68 import org.chromium.components.sync.signin.SystemAccountManagerDelegate; |
70 import org.chromium.content.app.ContentApplication; | 69 import org.chromium.content.app.ContentApplication; |
71 import org.chromium.content.browser.ChildProcessCreationParams; | 70 import org.chromium.content.browser.ChildProcessCreationParams; |
72 import org.chromium.policy.AppRestrictionsProvider; | 71 import org.chromium.policy.AppRestrictionsProvider; |
73 import org.chromium.policy.CombinedPolicyProvider; | 72 import org.chromium.policy.CombinedPolicyProvider; |
74 import org.chromium.policy.CombinedPolicyProvider.PolicyChangeListener; | 73 import org.chromium.policy.CombinedPolicyProvider.PolicyChangeListener; |
75 import org.chromium.printing.PrintingController; | 74 import org.chromium.printing.PrintingController; |
| 75 import org.chromium.ui.LocalePakFiles; |
76 import org.chromium.ui.base.ActivityWindowAndroid; | 76 import org.chromium.ui.base.ActivityWindowAndroid; |
77 import org.chromium.ui.base.ResourceBundle; | 77 import org.chromium.ui.base.ResourceBundle; |
78 | 78 |
79 /** | 79 /** |
80 * Basic application functionality that should be shared among all browser appli
cations that use | 80 * Basic application functionality that should be shared among all browser appli
cations that use |
81 * chrome layer. | 81 * chrome layer. |
82 */ | 82 */ |
83 public class ChromeApplication extends ContentApplication { | 83 public class ChromeApplication extends ContentApplication { |
84 public static final String COMMAND_LINE_FILE = "chrome-command-line"; | 84 public static final String COMMAND_LINE_FILE = "chrome-command-line"; |
85 | 85 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 protected void showSingleOriginSettings(String url) { | 168 protected void showSingleOriginSettings(String url) { |
169 Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite
(url); | 169 Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite
(url); |
170 Intent intent = PreferencesLauncher.createIntentForSettingsPage( | 170 Intent intent = PreferencesLauncher.createIntentForSettingsPage( |
171 this, SingleWebsitePreferences.class.getName()); | 171 this, SingleWebsitePreferences.class.getName()); |
172 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs)
; | 172 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs)
; |
173 startActivity(intent); | 173 startActivity(intent); |
174 } | 174 } |
175 | 175 |
176 @Override | 176 @Override |
177 protected void initializeLibraryDependencies() { | 177 protected void initializeLibraryDependencies() { |
178 // The ResourceExtractor is only needed by the browser process, but this
will have no | 178 ResourceBundle.initializeLocalePaks(LocalePakFiles.getFiles()); |
179 // impact on the renderer process construction. | |
180 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); | |
181 ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleRe
sources()); | 179 ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleRe
sources()); |
182 } | 180 } |
183 | 181 |
184 @Override | 182 @Override |
185 public void initCommandLine() { | 183 public void initCommandLine() { |
186 CommandLineInitUtil.initCommandLine(this, COMMAND_LINE_FILE); | 184 CommandLineInitUtil.initCommandLine(this, COMMAND_LINE_FILE); |
187 } | 185 } |
188 | 186 |
189 /** | 187 /** |
190 * Shows an error dialog following a startup error, and then exits the appli
cation. | 188 * Shows an error dialog following a startup error, and then exits the appli
cation. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 477 } |
480 | 478 |
481 /** | 479 /** |
482 * Creates a new {@link AccountManagerDelegate}. | 480 * Creates a new {@link AccountManagerDelegate}. |
483 * @return the created {@link AccountManagerDelegate}. | 481 * @return the created {@link AccountManagerDelegate}. |
484 */ | 482 */ |
485 public AccountManagerDelegate createAccountManagerDelegate() { | 483 public AccountManagerDelegate createAccountManagerDelegate() { |
486 return new SystemAccountManagerDelegate(this); | 484 return new SystemAccountManagerDelegate(this); |
487 } | 485 } |
488 } | 486 } |
OLD | NEW |