| 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.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.SharedPreferences; | 10 import android.content.SharedPreferences; |
| 11 import android.os.Bundle; | 11 import android.os.Bundle; |
| 12 import android.os.Handler; | 12 import android.os.Handler; |
| 13 import android.os.Looper; | 13 import android.os.Looper; |
| 14 import android.os.SystemClock; | 14 import android.os.SystemClock; |
| 15 import android.provider.Settings; | 15 import android.provider.Settings; |
| 16 import android.util.Log; | 16 import android.util.Log; |
| 17 import android.view.View; | 17 import android.view.View; |
| 18 | 18 |
| 19 import com.google.ipc.invalidation.external.client.android.service.AndroidLogger
; | 19 import com.google.ipc.invalidation.external.client.android.service.AndroidLogger
; |
| 20 | 20 |
| 21 import org.chromium.base.ActivityState; | 21 import org.chromium.base.ActivityState; |
| 22 import org.chromium.base.ApiCompatibilityUtils; | 22 import org.chromium.base.ApiCompatibilityUtils; |
| 23 import org.chromium.base.ApplicationState; | 23 import org.chromium.base.ApplicationState; |
| 24 import org.chromium.base.ApplicationStatus; | 24 import org.chromium.base.ApplicationStatus; |
| 25 import org.chromium.base.ApplicationStatus.ApplicationStateListener; | 25 import org.chromium.base.ApplicationStatus.ApplicationStateListener; |
| 26 import org.chromium.base.BuildInfo; | |
| 27 import org.chromium.base.CommandLine; | 26 import org.chromium.base.CommandLine; |
| 28 import org.chromium.base.CommandLineInitUtil; | 27 import org.chromium.base.CommandLineInitUtil; |
| 29 import org.chromium.base.ContextUtils; | 28 import org.chromium.base.ContextUtils; |
| 30 import org.chromium.base.ResourceExtractor; | 29 import org.chromium.base.ResourceExtractor; |
| 31 import org.chromium.base.ThreadUtils; | 30 import org.chromium.base.ThreadUtils; |
| 32 import org.chromium.base.TraceEvent; | 31 import org.chromium.base.TraceEvent; |
| 33 import org.chromium.base.VisibleForTesting; | 32 import org.chromium.base.VisibleForTesting; |
| 34 import org.chromium.base.annotations.CalledByNative; | 33 import org.chromium.base.annotations.CalledByNative; |
| 35 import org.chromium.base.annotations.SuppressFBWarnings; | 34 import org.chromium.base.annotations.SuppressFBWarnings; |
| 36 import org.chromium.base.library_loader.ProcessInitException; | 35 import org.chromium.base.library_loader.ProcessInitException; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 this, SingleWebsitePreferences.class.getName()); | 415 this, SingleWebsitePreferences.class.getName()); |
| 417 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs)
; | 416 intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs)
; |
| 418 startActivity(intent); | 417 startActivity(intent); |
| 419 } | 418 } |
| 420 | 419 |
| 421 @Override | 420 @Override |
| 422 protected void initializeLibraryDependencies() { | 421 protected void initializeLibraryDependencies() { |
| 423 // The ResourceExtractor is only needed by the browser process, but this
will have no | 422 // The ResourceExtractor is only needed by the browser process, but this
will have no |
| 424 // impact on the renderer process construction. | 423 // impact on the renderer process construction. |
| 425 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); | 424 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); |
| 426 if (!BuildInfo.hasLanguageApkSplits(this)) { | 425 ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleRe
sources()); |
| 427 ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLoca
leResources()); | |
| 428 } | |
| 429 } | 426 } |
| 430 | 427 |
| 431 /** | 428 /** |
| 432 * The host activity should call this after the native library has loaded to
ensure classes | 429 * The host activity should call this after the native library has loaded to
ensure classes |
| 433 * shared by Activities in the same process are properly initialized. | 430 * shared by Activities in the same process are properly initialized. |
| 434 */ | 431 */ |
| 435 public void initializeSharedClasses() { | 432 public void initializeSharedClasses() { |
| 436 if (mInitializedSharedClasses) return; | 433 if (mInitializedSharedClasses) return; |
| 437 mInitializedSharedClasses = true; | 434 mInitializedSharedClasses = true; |
| 438 | 435 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 * Caches flags that are needed by Activities that launch before the native
library is loaded | 848 * Caches flags that are needed by Activities that launch before the native
library is loaded |
| 852 * and stores them in SharedPreferences. Because this function is called dur
ing launch after the | 849 * and stores them in SharedPreferences. Because this function is called dur
ing launch after the |
| 853 * library has loaded, they won't affect the next launch until Chrome is res
tarted. | 850 * library has loaded, they won't affect the next launch until Chrome is res
tarted. |
| 854 */ | 851 */ |
| 855 private void cacheNativeFlags() { | 852 private void cacheNativeFlags() { |
| 856 if (sIsFinishedCachingNativeFlags) return; | 853 if (sIsFinishedCachingNativeFlags) return; |
| 857 FeatureUtilities.cacheNativeFlags(this); | 854 FeatureUtilities.cacheNativeFlags(this); |
| 858 sIsFinishedCachingNativeFlags = true; | 855 sIsFinishedCachingNativeFlags = true; |
| 859 } | 856 } |
| 860 } | 857 } |
| OLD | NEW |