| 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.Activity; | 7 import android.app.Activity; |
| 8 import android.app.PendingIntent; | 8 import android.app.PendingIntent; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 import org.chromium.base.Log; | 38 import org.chromium.base.Log; |
| 39 import org.chromium.base.ThreadUtils; | 39 import org.chromium.base.ThreadUtils; |
| 40 import org.chromium.base.VisibleForTesting; | 40 import org.chromium.base.VisibleForTesting; |
| 41 import org.chromium.base.metrics.RecordHistogram; | 41 import org.chromium.base.metrics.RecordHistogram; |
| 42 import org.chromium.base.metrics.RecordUserAction; | 42 import org.chromium.base.metrics.RecordUserAction; |
| 43 import org.chromium.chrome.R; | 43 import org.chromium.chrome.R; |
| 44 import org.chromium.chrome.browser.ChromeActivity; | 44 import org.chromium.chrome.browser.ChromeActivity; |
| 45 import org.chromium.chrome.browser.IntentHandler; | 45 import org.chromium.chrome.browser.IntentHandler; |
| 46 import org.chromium.chrome.browser.IntentHandler.ExternalAppId; | 46 import org.chromium.chrome.browser.IntentHandler.ExternalAppId; |
| 47 import org.chromium.chrome.browser.KeyboardShortcuts; | 47 import org.chromium.chrome.browser.KeyboardShortcuts; |
| 48 import org.chromium.chrome.browser.ServiceTabLauncher; |
| 48 import org.chromium.chrome.browser.UrlConstants; | 49 import org.chromium.chrome.browser.UrlConstants; |
| 49 import org.chromium.chrome.browser.WarmupManager; | 50 import org.chromium.chrome.browser.WarmupManager; |
| 50 import org.chromium.chrome.browser.WebContentsFactory; | 51 import org.chromium.chrome.browser.WebContentsFactory; |
| 51 import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate; | 52 import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate; |
| 52 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange
Reason; | 53 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange
Reason; |
| 53 import org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument; | 54 import org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument; |
| 54 import org.chromium.chrome.browser.datausage.DataUseTabUIManager; | 55 import org.chromium.chrome.browser.datausage.DataUseTabUIManager; |
| 55 import org.chromium.chrome.browser.document.ChromeLauncherActivity; | 56 import org.chromium.chrome.browser.document.ChromeLauncherActivity; |
| 56 import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; | 57 import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; |
| 57 import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; | 58 import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 } | 535 } |
| 535 DataUseTabUIManager.onCustomTabInitialNavigation(mMainTab, packageName,
url); | 536 DataUseTabUIManager.onCustomTabInitialNavigation(mMainTab, packageName,
url); |
| 536 | 537 |
| 537 if (!mHasCreatedTabEarly && !successfulStateRestore) { | 538 if (!mHasCreatedTabEarly && !successfulStateRestore) { |
| 538 loadUrlInTab(mMainTab, new LoadUrlParams(url), | 539 loadUrlInTab(mMainTab, new LoadUrlParams(url), |
| 539 IntentHandler.getTimestampFromIntent(getIntent())); | 540 IntentHandler.getTimestampFromIntent(getIntent())); |
| 540 } | 541 } |
| 541 | 542 |
| 542 // Put Sync in the correct state by calling tab state initialized. crbug
.com/581811. | 543 // Put Sync in the correct state by calling tab state initialized. crbug
.com/581811. |
| 543 getTabModelSelector().markTabStateInitialized(); | 544 getTabModelSelector().markTabStateInitialized(); |
| 545 |
| 546 // Notify ServiceTabLauncher if this is an asynchronous tab launch. |
| 547 if (getIntent().hasExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA)) { |
| 548 ServiceTabLauncher.onWebContentsForRequestAvailable( |
| 549 getIntent().getIntExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID
_EXTRA, 0), |
| 550 getActivityTab().getWebContents()); |
| 551 } |
| 544 super.finishNativeInitialization(); | 552 super.finishNativeInitialization(); |
| 545 } | 553 } |
| 546 | 554 |
| 547 /** | 555 /** |
| 548 * Encapsulates CustomTabsConnection#takeHiddenTab() | 556 * Encapsulates CustomTabsConnection#takeHiddenTab() |
| 549 * with additional initialization logic. | 557 * with additional initialization logic. |
| 550 */ | 558 */ |
| 551 private Tab getHiddenTab(CustomTabsConnection connection) { | 559 private Tab getHiddenTab(CustomTabsConnection connection) { |
| 552 String url = getUrlToLoad(); | 560 String url = getUrlToLoad(); |
| 553 String referrerUrl = connection.getReferrer(mSession, getIntent()); | 561 String referrerUrl = connection.getReferrer(mSession, getIntent()); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 // Custom Tabs can be used to open Chrome help pages before the ToS has
been accepted. | 1173 // Custom Tabs can be used to open Chrome help pages before the ToS has
been accepted. |
| 1166 if (IntentHandler.isIntentChromeOrFirstParty(intent) | 1174 if (IntentHandler.isIntentChromeOrFirstParty(intent) |
| 1167 && IntentUtils.safeGetBooleanExtra( | 1175 && IntentUtils.safeGetBooleanExtra( |
| 1168 intent, CustomTabIntentDataProvider.EXTRA_IS_INFO_PAG
E, false)) { | 1176 intent, CustomTabIntentDataProvider.EXTRA_IS_INFO_PAG
E, false)) { |
| 1169 return false; | 1177 return false; |
| 1170 } | 1178 } |
| 1171 | 1179 |
| 1172 return super.requiresFirstRunToBeCompleted(intent); | 1180 return super.requiresFirstRunToBeCompleted(intent); |
| 1173 } | 1181 } |
| 1174 } | 1182 } |
| OLD | NEW |