| 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.document; | 5 package org.chromium.chrome.browser.document; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.Notification; | 9 import android.app.Notification; |
| 10 import android.app.SearchManager; | 10 import android.app.SearchManager; |
| 11 import android.content.Context; | 11 import android.content.Context; |
| 12 import android.content.Intent; | 12 import android.content.Intent; |
| 13 import android.net.Uri; | 13 import android.net.Uri; |
| 14 import android.os.Build; | 14 import android.os.Build; |
| 15 import android.os.Bundle; | 15 import android.os.Bundle; |
| 16 import android.os.StrictMode; | 16 import android.os.StrictMode; |
| 17 import android.provider.Browser; | 17 import android.provider.Browser; |
| 18 import android.support.customtabs.CustomTabsIntent; | 18 import android.support.customtabs.CustomTabsIntent; |
| 19 import android.text.TextUtils; | 19 import android.text.TextUtils; |
| 20 | 20 |
| 21 import org.chromium.base.ApiCompatibilityUtils; | 21 import org.chromium.base.ApiCompatibilityUtils; |
| 22 import org.chromium.base.ApplicationStatus; | 22 import org.chromium.base.ApplicationStatus; |
| 23 import org.chromium.base.CommandLine; | 23 import org.chromium.base.CommandLine; |
| 24 import org.chromium.base.CommandLineInitUtil; | 24 import org.chromium.base.CommandLineInitUtil; |
| 25 import org.chromium.base.ContextUtils; | 25 import org.chromium.base.ContextUtils; |
| 26 import org.chromium.base.Log; | 26 import org.chromium.base.Log; |
| 27 import org.chromium.base.TraceEvent; | 27 import org.chromium.base.TraceEvent; |
| 28 import org.chromium.base.metrics.CachedMetrics; | |
| 29 import org.chromium.chrome.R; | 28 import org.chromium.chrome.R; |
| 30 import org.chromium.chrome.browser.ChromeApplication; | 29 import org.chromium.chrome.browser.ChromeApplication; |
| 31 import org.chromium.chrome.browser.ChromeSwitches; | 30 import org.chromium.chrome.browser.ChromeSwitches; |
| 32 import org.chromium.chrome.browser.ChromeTabbedActivity; | 31 import org.chromium.chrome.browser.ChromeTabbedActivity; |
| 33 import org.chromium.chrome.browser.IntentHandler; | 32 import org.chromium.chrome.browser.IntentHandler; |
| 34 import org.chromium.chrome.browser.IntentHandler.ExternalAppId; | 33 import org.chromium.chrome.browser.IntentHandler.ExternalAppId; |
| 35 import org.chromium.chrome.browser.IntentHandler.TabOpenType; | 34 import org.chromium.chrome.browser.IntentHandler.TabOpenType; |
| 36 import org.chromium.chrome.browser.ShortcutHelper; | 35 import org.chromium.chrome.browser.ShortcutHelper; |
| 37 import org.chromium.chrome.browser.UrlConstants; | 36 import org.chromium.chrome.browser.UrlConstants; |
| 38 import org.chromium.chrome.browser.WarmupManager; | 37 import org.chromium.chrome.browser.WarmupManager; |
| 39 import org.chromium.chrome.browser.customtabs.CustomTabActivity; | 38 import org.chromium.chrome.browser.customtabs.CustomTabActivity; |
| 40 import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; | 39 import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; |
| 41 import org.chromium.chrome.browser.customtabs.SeparateTaskCustomTabActivity; | 40 import org.chromium.chrome.browser.customtabs.SeparateTaskCustomTabActivity; |
| 42 import org.chromium.chrome.browser.firstrun.FirstRunActivity; | 41 import org.chromium.chrome.browser.firstrun.FirstRunActivity; |
| 43 import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; | 42 import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; |
| 44 import org.chromium.chrome.browser.firstrun.LightweightFirstRunActivity; | 43 import org.chromium.chrome.browser.firstrun.LightweightFirstRunActivity; |
| 45 import org.chromium.chrome.browser.instantapps.InstantAppsHandler; | 44 import org.chromium.chrome.browser.instantapps.InstantAppsHandler; |
| 45 import org.chromium.chrome.browser.metrics.LaunchMetrics; |
| 46 import org.chromium.chrome.browser.metrics.MediaNotificationUma; | 46 import org.chromium.chrome.browser.metrics.MediaNotificationUma; |
| 47 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; | 47 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
| 48 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; | 48 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; |
| 49 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza
tions; | 49 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza
tions; |
| 50 import org.chromium.chrome.browser.tab.Tab; | 50 import org.chromium.chrome.browser.tab.Tab; |
| 51 import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin; | 51 import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin; |
| 52 import org.chromium.chrome.browser.upgrade.UpgradeActivity; | 52 import org.chromium.chrome.browser.upgrade.UpgradeActivity; |
| 53 import org.chromium.chrome.browser.util.FeatureUtilities; | 53 import org.chromium.chrome.browser.util.FeatureUtilities; |
| 54 import org.chromium.chrome.browser.util.IntentUtils; | 54 import org.chromium.chrome.browser.util.IntentUtils; |
| 55 import org.chromium.chrome.browser.util.UrlUtilities; | 55 import org.chromium.chrome.browser.util.UrlUtilities; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 80 "org.chromium.chrome.browser.document.IS_ALLOWED_TO_RETURN_TO_PARENT
"; | 80 "org.chromium.chrome.browser.document.IS_ALLOWED_TO_RETURN_TO_PARENT
"; |
| 81 | 81 |
| 82 private static final String TAG = "document_CLActivity"; | 82 private static final String TAG = "document_CLActivity"; |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * Timeout in ms for reading PartnerBrowserCustomizations provider. We do no
t trust third party | 85 * Timeout in ms for reading PartnerBrowserCustomizations provider. We do no
t trust third party |
| 86 * provider by default. | 86 * provider by default. |
| 87 */ | 87 */ |
| 88 private static final int PARTNER_BROWSER_CUSTOMIZATIONS_TIMEOUT_MS = 10000; | 88 private static final int PARTNER_BROWSER_CUSTOMIZATIONS_TIMEOUT_MS = 10000; |
| 89 | 89 |
| 90 private static final CachedMetrics.SparseHistogramSample sIntentFlagsHistogr
am = | 90 private static final LaunchMetrics.SparseHistogramSample sIntentFlagsHistogr
am = |
| 91 new CachedMetrics.SparseHistogramSample("Launch.IntentFlags"); | 91 new LaunchMetrics.SparseHistogramSample("Launch.IntentFlags"); |
| 92 | 92 |
| 93 private IntentHandler mIntentHandler; | 93 private IntentHandler mIntentHandler; |
| 94 private boolean mIsInLegacyMultiInstanceMode; | 94 private boolean mIsInLegacyMultiInstanceMode; |
| 95 | 95 |
| 96 private boolean mIsCustomTabIntent; | 96 private boolean mIsCustomTabIntent; |
| 97 private boolean mIsHerbIntent; | 97 private boolean mIsHerbIntent; |
| 98 | 98 |
| 99 /** When started with an intent, maybe pre-resolve the domain. */ | 99 /** When started with an intent, maybe pre-resolve the domain. */ |
| 100 private void maybePrefetchDnsInBackground() { | 100 private void maybePrefetchDnsInBackground() { |
| 101 if (getIntent() != null && Intent.ACTION_VIEW.equals(getIntent().getActi
on())) { | 101 if (getIntent() != null && Intent.ACTION_VIEW.equals(getIntent().getActi
on())) { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 IntentHandler.ExternalAppId source = | 575 IntentHandler.ExternalAppId source = |
| 576 IntentHandler.determineExternalIntentSource(getPackageName(), in
tent); | 576 IntentHandler.determineExternalIntentSource(getPackageName(), in
tent); |
| 577 if (intent.getPackage() == null && source != IntentHandler.ExternalAppId
.CHROME) { | 577 if (intent.getPackage() == null && source != IntentHandler.ExternalAppId
.CHROME) { |
| 578 int flagsOfInterest = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_AC
TIVITY_NEW_DOCUMENT; | 578 int flagsOfInterest = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_AC
TIVITY_NEW_DOCUMENT; |
| 579 int maskedFlags = intent.getFlags() & flagsOfInterest; | 579 int maskedFlags = intent.getFlags() & flagsOfInterest; |
| 580 sIntentFlagsHistogram.record(maskedFlags); | 580 sIntentFlagsHistogram.record(maskedFlags); |
| 581 } | 581 } |
| 582 MediaNotificationUma.recordClickSource(intent); | 582 MediaNotificationUma.recordClickSource(intent); |
| 583 } | 583 } |
| 584 } | 584 } |
| OLD | NEW |