| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.customtabs; | 5 package org.chromium.chrome.browser.customtabs; |
| 6 | 6 |
| 7 import android.app.ActivityManager; | 7 import android.app.ActivityManager; |
| 8 import android.app.Application; | 8 import android.app.Application; |
| 9 import android.app.PendingIntent; | 9 import android.app.PendingIntent; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 import org.chromium.chrome.browser.WarmupManager; | 42 import org.chromium.chrome.browser.WarmupManager; |
| 43 import org.chromium.chrome.browser.WebContentsFactory; | 43 import org.chromium.chrome.browser.WebContentsFactory; |
| 44 import org.chromium.chrome.browser.device.DeviceClassManager; | 44 import org.chromium.chrome.browser.device.DeviceClassManager; |
| 45 import org.chromium.chrome.browser.init.ChromeBrowserInitializer; | 45 import org.chromium.chrome.browser.init.ChromeBrowserInitializer; |
| 46 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; | 46 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
| 47 import org.chromium.chrome.browser.preferences.PrefServiceBridge; | 47 import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| 48 import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; | 48 import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; |
| 49 import org.chromium.chrome.browser.profiles.Profile; | 49 import org.chromium.chrome.browser.profiles.Profile; |
| 50 import org.chromium.chrome.browser.util.IntentUtils; | 50 import org.chromium.chrome.browser.util.IntentUtils; |
| 51 import org.chromium.chrome.browser.util.UrlUtilities; | 51 import org.chromium.chrome.browser.util.UrlUtilities; |
| 52 import org.chromium.content.browser.ChildProcessCreationParams; |
| 52 import org.chromium.content.browser.ChildProcessLauncher; | 53 import org.chromium.content.browser.ChildProcessLauncher; |
| 53 import org.chromium.content_public.browser.LoadUrlParams; | 54 import org.chromium.content_public.browser.LoadUrlParams; |
| 54 import org.chromium.content_public.browser.WebContents; | 55 import org.chromium.content_public.browser.WebContents; |
| 55 import org.chromium.content_public.common.Referrer; | 56 import org.chromium.content_public.common.Referrer; |
| 56 | 57 |
| 57 import java.io.BufferedReader; | 58 import java.io.BufferedReader; |
| 58 import java.io.FileReader; | 59 import java.io.FileReader; |
| 59 import java.io.IOException; | 60 import java.io.IOException; |
| 60 import java.util.List; | 61 import java.util.List; |
| 61 import java.util.concurrent.Callable; | 62 import java.util.concurrent.Callable; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 try { | 170 try { |
| 170 ChromeBrowserInitializer.getInstance(app).handleSynchronousStartup()
; | 171 ChromeBrowserInitializer.getInstance(app).handleSynchronousStartup()
; |
| 171 } catch (ProcessInitException e) { | 172 } catch (ProcessInitException e) { |
| 172 Log.e(TAG, "ProcessInitException while starting the browser process.
"); | 173 Log.e(TAG, "ProcessInitException while starting the browser process.
"); |
| 173 // Cannot do anything without the native library, and cannot show a | 174 // Cannot do anything without the native library, and cannot show a |
| 174 // dialog to the user. | 175 // dialog to the user. |
| 175 System.exit(-1); | 176 System.exit(-1); |
| 176 } | 177 } |
| 177 final Context context = app.getApplicationContext(); | 178 final Context context = app.getApplicationContext(); |
| 178 final ChromeApplication chrome = (ChromeApplication) context; | 179 final ChromeApplication chrome = (ChromeApplication) context; |
| 180 ChildProcessCreationParams.set(chrome.getChildProcessCreationParams()); |
| 179 new AsyncTask<Void, Void, Void>() { | 181 new AsyncTask<Void, Void, Void>() { |
| 180 @Override | 182 @Override |
| 181 protected Void doInBackground(Void... params) { | 183 protected Void doInBackground(Void... params) { |
| 182 ChildProcessLauncher.warmUp(context, chrome.getChildProcessCreat
ionParams()); | 184 ChildProcessLauncher.warmUp(context); |
| 183 return null; | 185 return null; |
| 184 } | 186 } |
| 185 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); | 187 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); |
| 186 ChromeBrowserInitializer.initNetworkChangeNotifier(context); | 188 ChromeBrowserInitializer.initNetworkChangeNotifier(context); |
| 187 WarmupManager.getInstance().initializeViewHierarchy( | 189 WarmupManager.getInstance().initializeViewHierarchy( |
| 188 context, R.layout.custom_tabs_control_container); | 190 context, R.layout.custom_tabs_control_container); |
| 189 } | 191 } |
| 190 | 192 |
| 191 public boolean warmup(long flags) { | 193 public boolean warmup(long flags) { |
| 192 boolean success = warmupInternal(true); | 194 boolean success = warmupInternal(true); |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 screenSize.x /= density; | 775 screenSize.x /= density; |
| 774 screenSize.y /= density; | 776 screenSize.y /= density; |
| 775 return screenSize; | 777 return screenSize; |
| 776 } | 778 } |
| 777 | 779 |
| 778 @VisibleForTesting | 780 @VisibleForTesting |
| 779 void resetThrottling(Context context, int uid) { | 781 void resetThrottling(Context context, int uid) { |
| 780 mClientManager.resetThrottling(uid); | 782 mClientManager.resetThrottling(uid); |
| 781 } | 783 } |
| 782 } | 784 } |
| OLD | NEW |