Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
Update to 63.0.3239.90
Browse files Browse the repository at this point in the history
  • Loading branch information
kuoruan committed Dec 15, 2017
1 parent bce81da commit 4b392c0
Show file tree
Hide file tree
Showing 28 changed files with 124 additions and 126 deletions.
Binary file modified app/src/main/assets/icudtl.dat
Binary file not shown.
Binary file modified app/src/main/assets/snapshot_blob_32.bin
Binary file not shown.
Binary file modified app/src/main/assets/zh-CN.pak
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class NativeLibraries {
public static final String[] LIBRARIES =
{"chrome"};
static String sVersionNumber =
"63.0.3239.65";
"63.0.3239.90";
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public static boolean getFieldTrialParamByFeatureAsBoolean(
public static final String CHROME_HOME_PERSONALIZED_OMNIBOX_SUGGESTIONS =
"ChromeHomePersonalizedOmniboxSuggestions";
public static final String CHROME_HOME_PROMO = "ChromeHomePromo";
public static final String CHROME_HOME_PROMO_INFO_ONLY = "ChromeHomePromoInfoOnly";
public static final String CHROME_HOME_PROMO_ON_STARTUP = "ChromeHomePromoOnStartup";
public static final String CHROME_MEMEX = "ChromeMemex";
public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ interface ExternalNavigationDelegate {
/**
* Display a dialog warning the user that they may be leaving Chrome by starting this
* intent. Give the user the opportunity to cancel the action. And if it is canceled, a
* navigation will happen in Chrome.
* navigation will happen in Chrome. Catches BadTokenExceptions caused by showing the dialog
* on certain devices. (crbug.com/782602)
* @param intent The intent for external application that will be sent.
* @param referrerUrl The referrer for the current navigation.
* @param fallbackUrl The URL to load if the user doesn't proceed with external intent.
* @param tab The current tab.
* @param needsToCloseTab Whether the current tab has to be closed after the intent is sent.
* @param proxy Whether we need to proxy the intent through AuthenticatedProxyActivity (this is
* used by Instant Apps intents.
* @return True if the function returned error free, false if it threw an exception.
*/
void startIncognitoIntent(Intent intent, String referrerUrl, String fallbackUrl, Tab tab,
boolean startIncognitoIntent(Intent intent, String referrerUrl, String fallbackUrl, Tab tab,
boolean needsToCloseTab, boolean proxy);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.provider.Telephony;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.view.WindowManager.BadTokenException;
import android.webkit.MimeTypeMap;

import org.chromium.base.ApplicationState;
Expand Down Expand Up @@ -379,7 +380,19 @@ private void recordExternalNavigationDispatched(Intent intent) {
}

@Override
public void startIncognitoIntent(final Intent intent, final String referrerUrl,
public boolean startIncognitoIntent(final Intent intent, final String referrerUrl,
final String fallbackUrl, final Tab tab, final boolean needsToCloseTab,
final boolean proxy) {
try {
startIncognitoIntentInternal(
intent, referrerUrl, fallbackUrl, tab, needsToCloseTab, proxy);
} catch (BadTokenException e) {
return false;
}
return true;
}

private void startIncognitoIntentInternal(final Intent intent, final String referrerUrl,
final String fallbackUrl, final Tab tab, final boolean needsToCloseTab,
final boolean proxy) {
Context context = tab.getWindowAndroid().getContext().get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,13 @@ && resolversSubsetOf(resolvingInfos,
if (params.isIncognito() && !mDelegate.willChromeHandleIntent(intent)) {
// This intent may leave Chrome. Warn the user that incognito does not carry over
// to apps out side of Chrome.
mDelegate.startIncognitoIntent(intent, params.getReferrerUrl(),
hasBrowserFallbackUrl ? browserFallbackUrl : null, params.getTab(),
params.shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(),
shouldProxyForInstantApps);
if (!mDelegate.startIncognitoIntent(intent, params.getReferrerUrl(),
hasBrowserFallbackUrl ? browserFallbackUrl : null, params.getTab(),
params.shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(),
shouldProxyForInstantApps)) {
if (DEBUG) Log.i(TAG, "NO_OVERRIDE: Failed to show incognito alert dialog.");
return OverrideUrlLoadingResult.NO_OVERRIDE;
}
if (DEBUG) Log.i(TAG, "OVERRIDE_WITH_ASYNC_ACTION: Incognito navigation out");
return OverrideUrlLoadingResult.OVERRIDE_WITH_ASYNC_ACTION;
}
Expand Down Expand Up @@ -572,9 +575,13 @@ private OverrideUrlLoadingResult sendIntentToMarket(String packageName, String m
intent.putExtra(Intent.EXTRA_REFERRER, Uri.parse(params.getReferrerUrl()));
}
if (params.isIncognito()) {
mDelegate.startIncognitoIntent(intent, params.getReferrerUrl(), null,
params.getTab(),
params.shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(), false);
if (!mDelegate.startIncognitoIntent(intent, params.getReferrerUrl(), null,
params.getTab(),
params.shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(),
false)) {
if (DEBUG) Log.i(TAG, "NO_OVERRIDE: Failed to show incognito alert dialog.");
return OverrideUrlLoadingResult.NO_OVERRIDE;
}
if (DEBUG) Log.i(TAG, "OVERRIDE_WITH_ASYNC_ACTION: Incognito intent to Play Store");
return OverrideUrlLoadingResult.OVERRIDE_WITH_ASYNC_ACTION;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ private static JSONArray getAssetStatements(String packageName, PackageManager p
// Get the <meta-data> from this app's manifest.
// Throws NameNotFoundException if the application is not installed.
ApplicationInfo appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
if (appInfo == null || appInfo.metaData == null) {
return new JSONArray();
}

int identifier = appInfo.metaData.getInt(ASSET_STATEMENTS_KEY);
if (identifier == 0) {
return new JSONArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
Expand All @@ -21,6 +22,7 @@
import org.chromium.base.ContextUtils;
import org.chromium.base.FieldTrialList;
import org.chromium.base.Log;
import org.chromium.base.StrictModeContext;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
Expand Down Expand Up @@ -52,6 +54,8 @@ public class FeatureUtilities {
private static final String ENABLED_EXPERIMENT_GROUP = "Enabled";
private static final String DISABLED_EXPERIMENT_GROUP = "Disabled";

private static final long CHROME_HOME_MAX_ENABLED_TIME_MS = 60000; // 60 seconds.

private static Boolean sHasGoogleAccountAuthenticator;
private static Boolean sHasRecognitionIntentHandler;
private static Boolean sChromeHomeEnabled;
Expand Down Expand Up @@ -375,16 +379,36 @@ public static String getChromeHomeSwipeLogicType() {
* @return Whether the Chrome Home promo should be shown for cold-start.
*/
public static boolean shouldShowChromeHomePromoForStartup() {
if (DeviceFormFactor.isTablet() || isChromeHomeEnabled()
|| !ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO)
|| !ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO_ON_STARTUP)) {
return false;
}
if (DeviceFormFactor.isTablet()) return false;

// The preference will be set if the promo has been seen before. If that is the case, do not
// show it again.
ChromePreferenceManager prefManager = ChromePreferenceManager.getInstance();
boolean isChromeHomePrefSet = prefManager.isChromeHomeUserPreferenceSet();
if (isChromeHomePrefSet) return false;

if (isChromeHomeEnabled()
&& ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO_INFO_ONLY)) {
long chromeHomeEnabledDate = System.currentTimeMillis();

try (StrictModeContext unused = StrictModeContext.allowDiskReads()) {
SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
chromeHomeEnabledDate = sharedPreferences.getLong(
ChromePreferenceManager.CHROME_HOME_SHARED_PREFERENCES_KEY,
chromeHomeEnabledDate);
}

long timeDeadlineForPromo = chromeHomeEnabledDate + CHROME_HOME_MAX_ENABLED_TIME_MS;

// If Chrome Home has been enabled for < 60 seconds, show the info dialog.
return System.currentTimeMillis() < timeDeadlineForPromo;
} else if (!isChromeHomeEnabled()
&& ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO)
&& ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO_ON_STARTUP)) {
return true;
}

// Don't show the promo is the user has Chrome Home enabled.
return !prefManager.isChromeHomeUserPreferenceSet();
return false;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public boolean startActivityIfNeeded(Intent intent, boolean proxy) {
}

@Override
public void startIncognitoIntent(Intent intent, String referrerUrl, String fallbackUrl, Tab tab,
boolean needsToCloseTab, boolean proxy) {
public boolean startIncognitoIntent(Intent intent, String referrerUrl, String fallbackUrl,
Tab tab, boolean needsToCloseTab, boolean proxy) {
VrShellDelegate.showDoffAndExitVr(false);
return true;
}

@Override
Expand Down
Loading

0 comments on commit 4b392c0

Please sign in to comment.