OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.tabmodel.document; | 5 package org.chromium.chrome.browser.tabmodel.document; |
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.text.TextUtils; | 10 import android.text.TextUtils; |
11 | 11 |
| 12 import org.chromium.base.ApiCompatibilityUtils; |
12 import org.chromium.base.ApplicationStatus; | 13 import org.chromium.base.ApplicationStatus; |
13 import org.chromium.chrome.browser.IntentHandler; | 14 import org.chromium.chrome.browser.IntentHandler; |
14 import org.chromium.chrome.browser.TabState; | 15 import org.chromium.chrome.browser.TabState; |
15 import org.chromium.chrome.browser.UrlConstants; | 16 import org.chromium.chrome.browser.UrlConstants; |
16 import org.chromium.chrome.browser.document.ChromeLauncherActivity; | 17 import org.chromium.chrome.browser.document.ChromeLauncherActivity; |
17 import org.chromium.chrome.browser.document.DocumentMetricIds; | 18 import org.chromium.chrome.browser.document.DocumentMetricIds; |
18 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; | 19 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
19 import org.chromium.chrome.browser.tab.Tab; | 20 import org.chromium.chrome.browser.tab.Tab; |
20 import org.chromium.chrome.browser.tab.TabIdManager; | 21 import org.chromium.chrome.browser.tab.TabIdManager; |
21 import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager; | 22 import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 186 } |
186 | 187 |
187 if (asyncParams.getRequestId() != null) { | 188 if (asyncParams.getRequestId() != null) { |
188 intent.putExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, | 189 intent.putExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, |
189 asyncParams.getRequestId().intValue()); | 190 asyncParams.getRequestId().intValue()); |
190 } | 191 } |
191 | 192 |
192 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 193 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
193 return intent; | 194 return intent; |
194 } | 195 } |
195 } | 196 |
| 197 /** |
| 198 * Passes the supplied web app launch intent to the IntentHandler. |
| 199 * @param intent Web app launch intent. |
| 200 */ |
| 201 public void createNewStandaloneFrame(Intent intent) { |
| 202 assert intent != null; |
| 203 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
| 204 | ApiCompatibilityUtils.getActivityNewDocumentFlag()); |
| 205 IntentHandler.startActivityForTrustedIntent(intent, |
| 206 ApplicationStatus.getApplicationContext()); |
| 207 } |
| 208 } |
OLD | NEW |