| 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.PendingIntent; | 7 import android.app.PendingIntent; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.SharedPreferences; | 10 import android.content.SharedPreferences; |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 389 } |
| 390 | 390 |
| 391 @Override | 391 @Override |
| 392 public void finishNativeInitialization() { | 392 public void finishNativeInitialization() { |
| 393 if (!mIntentDataProvider.isInfoPage()) FirstRunSignInProcessor.start(thi
s); | 393 if (!mIntentDataProvider.isInfoPage()) FirstRunSignInProcessor.start(thi
s); |
| 394 | 394 |
| 395 final CustomTabsConnection connection = CustomTabsConnection.getInstance
(getApplication()); | 395 final CustomTabsConnection connection = CustomTabsConnection.getInstance
(getApplication()); |
| 396 // If extra headers have been passed, cancel any current prerender, as | 396 // If extra headers have been passed, cancel any current prerender, as |
| 397 // prerendering doesn't support extra headers. | 397 // prerendering doesn't support extra headers. |
| 398 if (IntentHandler.getExtraHeadersFromIntent(getIntent()) != null) { | 398 if (IntentHandler.getExtraHeadersFromIntent(getIntent()) != null) { |
| 399 connection.cancelPrerender(mSession); | 399 connection.cancelSpeculation(mSession); |
| 400 } | 400 } |
| 401 | 401 |
| 402 getTabModelSelector().getModel(false).addObserver(mTabModelObserver); | 402 getTabModelSelector().getModel(false).addObserver(mTabModelObserver); |
| 403 | 403 |
| 404 boolean successfulStateRestore = false; | 404 boolean successfulStateRestore = false; |
| 405 // Attempt to restore the previous tab state if applicable. | 405 // Attempt to restore the previous tab state if applicable. |
| 406 if (getSavedInstanceState() != null) { | 406 if (getSavedInstanceState() != null) { |
| 407 assert mMainTab == null; | 407 assert mMainTab == null; |
| 408 getTabModelSelector().loadState(true); | 408 getTabModelSelector().loadState(true); |
| 409 getTabModelSelector().restoreTabs(true); | 409 getTabModelSelector().restoreTabs(true); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 Intent intent = ChromeLauncherActivity.createCustomTabActivityIntent( | 1094 Intent intent = ChromeLauncherActivity.createCustomTabActivityIntent( |
| 1095 context, customTabIntent.intent, false); | 1095 context, customTabIntent.intent, false); |
| 1096 intent.setPackage(context.getPackageName()); | 1096 intent.setPackage(context.getPackageName()); |
| 1097 intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_INFO_PAGE, true); | 1097 intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_INFO_PAGE, true); |
| 1098 intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); | 1098 intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); |
| 1099 IntentHandler.addTrustedIntentExtras(intent); | 1099 IntentHandler.addTrustedIntentExtras(intent); |
| 1100 | 1100 |
| 1101 context.startActivity(intent); | 1101 context.startActivity(intent); |
| 1102 } | 1102 } |
| 1103 } | 1103 } |
| OLD | NEW |