| 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; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.AsyncTask; | 8 import android.os.AsyncTask; |
| 9 import android.view.ContextThemeWrapper; | 9 import android.view.ContextThemeWrapper; |
| 10 import android.view.LayoutInflater; | 10 import android.view.LayoutInflater; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 public void prerenderUrl(final String url, final String referrer, | 124 public void prerenderUrl(final String url, final String referrer, |
| 125 final int widthPix, final int heightPix) { | 125 final int widthPix, final int heightPix) { |
| 126 ThreadUtils.assertOnUiThread(); | 126 ThreadUtils.assertOnUiThread(); |
| 127 if (!mPrerenderIsAllowed) return; | 127 if (!mPrerenderIsAllowed) return; |
| 128 clearWebContentsIfNecessary(); | 128 clearWebContentsIfNecessary(); |
| 129 if (mExternalPrerenderHandler == null) { | 129 if (mExternalPrerenderHandler == null) { |
| 130 mExternalPrerenderHandler = new ExternalPrerenderHandler(); | 130 mExternalPrerenderHandler = new ExternalPrerenderHandler(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 mPrerenderedWebContents = mExternalPrerenderHandler.addPrerender( | 133 mPrerenderedWebContents = mExternalPrerenderHandler.addPrerender( |
| 134 Profile.getLastUsedProfile(), url, referrer, widthPix, heightPix
); | 134 Profile.getLastUsedProfile(), url, referrer, widthPix, heightPix
, false); |
| 135 if (mPrerenderedWebContents != null) mPrerendered = true; | 135 if (mPrerenderedWebContents != null) mPrerendered = true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * Inflates and constructs the view hierarchy that the app will use. | 139 * Inflates and constructs the view hierarchy that the app will use. |
| 140 * @param baseContext The base context to use for creating the ContextWrappe
r. | 140 * @param baseContext The base context to use for creating the ContextWrappe
r. |
| 141 * @param toolbarContainerId Id of the toolbar container. | 141 * @param toolbarContainerId Id of the toolbar container. |
| 142 */ | 142 */ |
| 143 public void initializeViewHierarchy(Context baseContext, int toolbarContaine
rId) { | 143 public void initializeViewHierarchy(Context baseContext, int toolbarContaine
rId) { |
| 144 TraceEvent.begin("WarmupManager.initializeViewHierarchy"); | 144 TraceEvent.begin("WarmupManager.initializeViewHierarchy"); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // different profiles, the last one will win. | 280 // different profiles, the last one will win. |
| 281 mPendingPreconnectWithProfile.put(url, profile); | 281 mPendingPreconnectWithProfile.put(url, profile); |
| 282 } else { | 282 } else { |
| 283 nativePreconnectUrlAndSubresources(profile, url); | 283 nativePreconnectUrlAndSubresources(profile, url); |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 private static native void nativePreconnectUrlAndSubresources(Profile profil
e, String url); | 288 private static native void nativePreconnectUrlAndSubresources(Profile profil
e, String url); |
| 289 } | 289 } |
| OLD | NEW |