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.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.net.Uri; | 9 import android.net.Uri; |
10 import android.os.AsyncTask; | 10 import android.os.AsyncTask; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Otherwise, open the URL in a tab. | 97 // Otherwise, open the URL in a tab. |
98 final WebappDataStorage storage = | 98 final WebappDataStorage storage = |
99 WebappRegistry.getInstance().getWebappDataStorageForUrl(url); | 99 WebappRegistry.getInstance().getWebappDataStorageForUrl(url); |
100 | 100 |
101 // Open a new tab if: | 101 // Open a new tab if: |
102 // - We did not find a WebappDataStorage corresponding to this URL. | 102 // - We did not find a WebappDataStorage corresponding to this URL. |
103 // OR | 103 // OR |
104 // - The WebappDataStorage hasn't been opened recently enough. | 104 // - The WebappDataStorage hasn't been opened recently enough. |
105 // OR | 105 // OR |
106 // - The WebappDataStorage corresponds to a WebAPK (and WebAPKs are disa
bled). | 106 // - The WebappDataStorage corresponds to a WebAPK (and WebAPKs are disa
bled). |
107 if (storage == null || !storage.wasLaunchedRecently() | 107 if (storage == null || !storage.wasUsedRecently() |
108 || storage.getWebApkPackageName() != null) { | 108 || storage.getWebApkPackageName() != null) { |
109 LoadUrlParams loadUrlParams = new LoadUrlParams(url, PageTransition.
LINK); | 109 LoadUrlParams loadUrlParams = new LoadUrlParams(url, PageTransition.
LINK); |
110 loadUrlParams.setPostData(postData); | 110 loadUrlParams.setPostData(postData); |
111 loadUrlParams.setVerbatimHeaders(extraHeaders); | 111 loadUrlParams.setVerbatimHeaders(extraHeaders); |
112 loadUrlParams.setReferrer(new Referrer(referrerUrl, referrerPolicy))
; | 112 loadUrlParams.setReferrer(new Referrer(referrerUrl, referrerPolicy))
; |
113 | 113 |
114 AsyncTabCreationParams asyncParams = new AsyncTabCreationParams(load
UrlParams, | 114 AsyncTabCreationParams asyncParams = new AsyncTabCreationParams(load
UrlParams, |
115 requestId); | 115 requestId); |
116 tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, | 116 tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, |
117 Tab.INVALID_TAB_ID); | 117 Tab.INVALID_TAB_ID); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 * @param webContents The WebContents instance associated with this request. | 181 * @param webContents The WebContents instance associated with this request. |
182 */ | 182 */ |
183 public static void onWebContentsForRequestAvailable( | 183 public static void onWebContentsForRequestAvailable( |
184 int requestId, @Nullable WebContents webContents) { | 184 int requestId, @Nullable WebContents webContents) { |
185 nativeOnWebContentsForRequestAvailable(requestId, webContents); | 185 nativeOnWebContentsForRequestAvailable(requestId, webContents); |
186 } | 186 } |
187 | 187 |
188 private static native void nativeOnWebContentsForRequestAvailable( | 188 private static native void nativeOnWebContentsForRequestAvailable( |
189 int requestId, WebContents webContents); | 189 int requestId, WebContents webContents); |
190 } | 190 } |
OLD | NEW |