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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 */ | 1127 */ |
1128 private void launchUrlInHiddenTab( | 1128 private void launchUrlInHiddenTab( |
1129 final CustomTabsSessionToken session, final String url, final Bundle
extras) { | 1129 final CustomTabsSessionToken session, final String url, final Bundle
extras) { |
1130 ThreadUtils.postOnUiThread(new Runnable() { | 1130 ThreadUtils.postOnUiThread(new Runnable() { |
1131 @Override | 1131 @Override |
1132 public void run() { | 1132 public void run() { |
1133 Intent extrasIntent = new Intent(); | 1133 Intent extrasIntent = new Intent(); |
1134 if (extras != null) extrasIntent.putExtras(extras); | 1134 if (extras != null) extrasIntent.putExtras(extras); |
1135 if (IntentHandler.getExtraHeadersFromIntent(extrasIntent) != nul
l) return; | 1135 if (IntentHandler.getExtraHeadersFromIntent(extrasIntent) != nul
l) return; |
1136 | 1136 |
1137 Tab tab = Tab.createDetached(new CustomTabDelegateFactory(false,
false, null)); | 1137 Tab tab = |
| 1138 Tab.createDetached(new CustomTabDelegateFactory(false, f
alse, null), false); |
1138 | 1139 |
1139 // Updating post message as soon as we have a valid WebContents. | 1140 // Updating post message as soon as we have a valid WebContents. |
1140 mClientManager.resetPostMessageHandlerForSession( | 1141 mClientManager.resetPostMessageHandlerForSession( |
1141 session, tab.getContentViewCore().getWebContents()); | 1142 session, tab.getContentViewCore().getWebContents()); |
1142 | 1143 |
1143 LoadUrlParams loadParams = new LoadUrlParams(url); | 1144 LoadUrlParams loadParams = new LoadUrlParams(url); |
1144 String referrer = getReferrer(session, extrasIntent); | 1145 String referrer = getReferrer(session, extrasIntent); |
1145 if (referrer != null && !referrer.isEmpty()) { | 1146 if (referrer != null && !referrer.isEmpty()) { |
1146 loadParams.setReferrer( | 1147 loadParams.setReferrer( |
1147 new Referrer(referrer, Referrer.REFERRER_POLICY_DEFA
ULT)); | 1148 new Referrer(referrer, Referrer.REFERRER_POLICY_DEFA
ULT)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 private static void recordSpeculationStatusOnStart(int status) { | 1202 private static void recordSpeculationStatusOnStart(int status) { |
1202 RecordHistogram.recordEnumeratedHistogram( | 1203 RecordHistogram.recordEnumeratedHistogram( |
1203 "CustomTabs.SpeculationStatusOnStart", status, SPECULATION_STATU
S_ON_START_MAX); | 1204 "CustomTabs.SpeculationStatusOnStart", status, SPECULATION_STATU
S_ON_START_MAX); |
1204 } | 1205 } |
1205 | 1206 |
1206 private static void recordSpeculationStatusOnSwap(int status) { | 1207 private static void recordSpeculationStatusOnSwap(int status) { |
1207 RecordHistogram.recordEnumeratedHistogram( | 1208 RecordHistogram.recordEnumeratedHistogram( |
1208 "CustomTabs.SpeculationStatusOnSwap", status, SPECULATION_STATUS
_ON_SWAP_MAX); | 1209 "CustomTabs.SpeculationStatusOnSwap", status, SPECULATION_STATUS
_ON_SWAP_MAX); |
1209 } | 1210 } |
1210 } | 1211 } |
OLD | NEW |