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

Commit a109795

Browse files
committed
Update to 63.0.3239.40
1 parent 39aee8d commit a109795

27 files changed

+297
-48
lines changed

Chromium/args.gn

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ enable_nacl = false
1010
remove_webcore_debug_symbols = true
1111
proprietary_codecs = true
1212
ffmpeg_branding = "Chrome"
13-
exclude_unwind_tables = true

app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ idea {
6060
}
6161

6262
dependencies {
63-
implementation fileTree(include: ['*.jar'], dir: 'libs')
63+
implementation fileTree(include: ['*.jar'], dir: 'libs')
6464
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
6565
implementation "com.android.support:design:$rootProject.ext.supportLibraryVersion"
6666
implementation "com.android.support:gridlayout-v7:$rootProject.ext.supportLibraryVersion"

app/libs/gcm.jar

0 Bytes
Binary file not shown.

app/src/main/AndroidManifest.xml

+15-3
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,9 @@ by a child template that "extends" this file.
602602
<category android:name="com.google.intent.category.CARDBOARD" />
603603
</intent-filter>
604604
</activity>
605+
<!-- TODO(crbug.com/780674): retarget .Main back to CTA for non-modern APK -->
605606
<activity-alias android:name="com.google.android.apps.chrome.Main"
606-
android:targetActivity="org.chromium.chrome.browser.ChromeTabbedActivity"
607+
android:targetActivity="org.chromium.chrome.browser.document.ChromeLauncherActivity"
607608
android:exported="true">
608609
<intent-filter>
609610
<action android:name="android.intent.action.MAIN" />
@@ -669,19 +670,30 @@ by a child template that "extends" this file.
669670
</activity>
670671
<activity android:name="org.chromium.chrome.browser.firstrun.LightweightFirstRunActivity"
671672
android:theme="@style/SimpleDialog"
672-
android:launchMode="singleInstance"
673+
android:launchMode="singleInstance"
674+
android:excludeFromRecents="true"
673675
android:autoRemoveFromRecents="true"
674676
android:windowSoftInputMode="stateHidden|adjustPan"
675677
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
678+
>
676679
</activity>
677680
<activity android:name="org.chromium.chrome.browser.firstrun.FirstRunActivity"
678-
android:theme="@style/DialogWhenLarge"
681+
android:theme="@style/FirstRunTheme"
679682
android:launchMode="singleInstance"
680683
android:excludeFromRecents="true"
681684
android:autoRemoveFromRecents="true"
682685
android:windowSoftInputMode="stateHidden|adjustPan"
683686
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
684687
</activity>
688+
<activity android:name="org.chromium.chrome.browser.firstrun.TabbedModeFirstRunActivity"
689+
android:theme="@style/TabbedModeFirstRunTheme"
690+
android:launchMode="singleInstance"
691+
android:excludeFromRecents="true"
692+
android:autoRemoveFromRecents="true"
693+
android:windowSoftInputMode="stateHidden|adjustPan"
694+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
695+
>
696+
</activity>
685697
<activity android:name="org.chromium.chrome.browser.vr_shell.VrFirstRunActivity"
686698
android:exported="false"
687699
android:launchMode="singleInstance"

app/src/main/assets/resources.pak

-120 Bytes
Binary file not shown.

app/src/main/java/org/chromium/base/library_loader/NativeLibraries.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ public class NativeLibraries {
88
public static final String[] LIBRARIES =
99
{"chrome"};
1010
static String sVersionNumber =
11-
"63.0.3239.30";
11+
"63.0.3239.40";
1212
}

app/src/main/java/org/chromium/chrome/browser/ChromeActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public AppMenuHandler get(Activity activity, AppMenuPropertiesDelegate delegate,
237237
private boolean mDeferredStartupPosted;
238238

239239
private boolean mTabModelsInitialized;
240-
private boolean mNativeInitialized;
240+
protected boolean mNativeInitialized;
241241
private boolean mRemoveWindowBackgroundDone;
242242

243243
// The class cannot implement TouchExplorationStateChangeListener,

app/src/main/java/org/chromium/chrome/browser/ChromeTabbedActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,7 @@ protected void setStatusBarColor(Tab tab, int color) {
22652265
@Override
22662266
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
22672267
super.onMultiWindowModeChanged(isInMultiWindowMode);
2268-
if (!FeatureUtilities.isTabModelMergingEnabled()) return;
2268+
if (!FeatureUtilities.isTabModelMergingEnabled() || !mNativeInitialized) return;
22692269
if (!isInMultiWindowMode) {
22702270
// If the activity is currently resumed when multi-window mode is exited, try to merge
22712271
// tabs from the other activity instance.

app/src/main/java/org/chromium/chrome/browser/ChromeVersionConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ChromeVersionConstants {
88
static final String PRODUCT_NAME = "Chromium";
9-
static final String PRODUCT_VERSION = "63.0.3239.30";
9+
static final String PRODUCT_VERSION = "63.0.3239.40";
1010
static final boolean IS_OFFICIAL_BUILD = 1 == 1;
1111

1212
static final int PRODUCT_MAJOR_VERSION = 63;

app/src/main/java/org/chromium/chrome/browser/IntentHandler.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.chromium.base.metrics.RecordUserAction;
2929
import org.chromium.blink_public.web.WebReferrerPolicy;
3030
import org.chromium.chrome.browser.browserservices.BrowserSessionContentUtils;
31+
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
3132
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
3233
import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
3334
import org.chromium.chrome.browser.externalnav.IntentWithGesturesHandler;
@@ -236,15 +237,6 @@ private static ComponentName getFakeComponentName(String packageName) {
236237
public static final String GOOGLECHROME_NAVIGATE_PREFIX =
237238
GOOGLECHROME_SCHEME + "://navigate?url=";
238239

239-
/**
240-
* The class name to be specified in the ComponentName for Intents that are creating a new
241-
* tab (regardless of whether the user is in document or tabbed mode).
242-
*/
243-
// TODO(tedchoc): Remove this and directly reference the Launcher activity when that becomes
244-
// publicly available.
245-
private static final String TAB_ACTIVITY_COMPONENT_CLASS_NAME =
246-
"com.google.android.apps.chrome.Main";
247-
248240
private static boolean sTestIntentsEnabled;
249241

250242
private final IntentHandlerDelegate mDelegate;
@@ -610,7 +602,7 @@ public static void startActivityForTrustedIntent(Intent intent) {
610602
public static void startChromeLauncherActivityForTrustedIntent(Intent intent) {
611603
// Specify the exact component that will handle creating a new tab. This allows specifying
612604
// URLs that are not exposed in the intent filters (i.e. chrome://).
613-
startActivityForTrustedIntentInternal(intent, TAB_ACTIVITY_COMPONENT_CLASS_NAME);
605+
startActivityForTrustedIntentInternal(intent, ChromeLauncherActivity.class.getName());
614606
}
615607

616608
private static void startActivityForTrustedIntentInternal(

app/src/main/java/org/chromium/chrome/browser/firstrun/FirstRunActivity.java

+16-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
import android.app.Activity;
88
import android.app.Fragment;
99
import android.os.Bundle;
10+
import android.support.annotation.CallSuper;
1011
import android.support.annotation.StringRes;
1112
import android.text.TextUtils;
13+
import android.view.View;
1214

1315
import org.chromium.base.ActivityState;
1416
import org.chromium.base.ApplicationStatus;
@@ -179,16 +181,26 @@ protected Bundle transformSavedInstanceStateForOnCreate(Bundle savedInstanceStat
179181
return null;
180182
}
181183

184+
/**
185+
* Creates the content view for this activity.
186+
* The only thing subclasses can do is wrapping the view returned by super implementation
187+
* in some extra layout.
188+
*/
189+
@CallSuper
190+
protected View createContentView() {
191+
mPager = new FirstRunViewPager(this);
192+
mPager.setId(R.id.fre_pager);
193+
mPager.setOffscreenPageLimit(3);
194+
return mPager;
195+
}
196+
182197
@Override
183198
public void setContentView() {
184199
initializeStateFromLaunchData();
185200

186201
setFinishOnTouchOutside(true);
187202

188-
mPager = new FirstRunViewPager(this);
189-
mPager.setId(R.id.fre_pager);
190-
mPager.setOffscreenPageLimit(3);
191-
setContentView(mPager);
203+
setContentView(createContentView());
192204

193205
mFirstRunFlowSequencer = new FirstRunFlowSequencer(this) {
194206
@Override

app/src/main/java/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java

+45
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.app.PendingIntent;
1010
import android.content.Context;
1111
import android.content.Intent;
12+
import android.content.res.TypedArray;
1213
import android.os.Bundle;
1314
import android.support.annotation.Nullable;
1415
import android.text.TextUtils;
@@ -18,6 +19,7 @@
1819
import org.chromium.base.CommandLine;
1920
import org.chromium.base.Log;
2021
import org.chromium.base.VisibleForTesting;
22+
import org.chromium.chrome.R;
2123
import org.chromium.chrome.browser.ChromeSwitches;
2224
import org.chromium.chrome.browser.locale.LocaleManager;
2325
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
@@ -366,6 +368,14 @@ public static boolean launch(Context caller, Intent intent, boolean requiresBroa
366368
freCallerIntent = new Intent(intent);
367369
VrIntentUtils.updateFreCallerIntent(caller, intent);
368370
}
371+
372+
if (maybeSwitchToTabbedMode(caller, freIntent)) {
373+
// We switched to TabbedModeFRE. We need to disable animation on the original
374+
// intent, to make transition seamless.
375+
intent = new Intent(intent);
376+
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
377+
}
378+
369379
// Add a PendingIntent so that the intent used to launch Chrome will be resent when
370380
// First Run is completed or canceled.
371381
addPendingIntent(caller, freIntent, intent, requiresBroadcast);
@@ -384,4 +394,39 @@ public static boolean launch(Context caller, Intent intent, boolean requiresBroa
384394
}
385395
return true;
386396
}
397+
398+
/**
399+
* On tablets, where FRE activity is a dialog, transitions from fillscreen activities
400+
* (the ones that use TabbedModeTheme, e.g. ChromeTabbedActivity) look ugly, because
401+
* when FRE is started from CTA.onCreate(), currently running animation for CTA window
402+
* is aborted. This is perceived as a flash of white and doesn't look good.
403+
*
404+
* To solve this, we added TabbedMode FRE activity, which has the same window background
405+
* as TabbedModeTheme activities, but shows content in a FRE-like dialog.
406+
*
407+
* This function attempts to switch FRE to TabbedModeFRE if certain conditions are met.
408+
*/
409+
private static boolean maybeSwitchToTabbedMode(Context caller, Intent freIntent) {
410+
// Caller must be an activity.
411+
if (!(caller instanceof Activity)) return false;
412+
413+
// We must be on a tablet (where FRE is a dialog).
414+
boolean isTablet = caller.getResources().getBoolean(R.bool.is_tablet);
415+
if (!isTablet) return false;
416+
417+
// Caller must use a theme with @drawable/window_background (the same background
418+
// used by TabbedModeFRE).
419+
TypedArray a = caller.obtainStyledAttributes(new int[] {android.R.attr.windowBackground});
420+
int backgroundResourceId = a.getResourceId(0 /* index */, 0);
421+
a.recycle();
422+
if (backgroundResourceId != R.drawable.window_background) return false;
423+
424+
// Switch FRE -> TabbedModeFRE.
425+
if (FirstRunActivity.class.getName().equals(freIntent.getComponent().getClassName())) {
426+
freIntent.setClass(caller, TabbedModeFirstRunActivity.class);
427+
return true;
428+
}
429+
430+
return false;
431+
}
387432
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// Copyright 2017 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package org.chromium.chrome.browser.firstrun;
6+
7+
import android.content.Context;
8+
import android.content.res.Resources;
9+
import android.support.annotation.AnyRes;
10+
import android.util.DisplayMetrics;
11+
import android.util.TypedValue;
12+
import android.view.Gravity;
13+
import android.view.View;
14+
import android.view.ViewGroup;
15+
import android.widget.FrameLayout;
16+
17+
import org.chromium.chrome.R;
18+
19+
/**
20+
* FirstRunActivity variant that fills the whole screen, but displays the content
21+
* in a dialog-like layout.
22+
*/
23+
public class TabbedModeFirstRunActivity extends FirstRunActivity {
24+
@Override
25+
protected View createContentView() {
26+
return wrapInDialogLayout(super.createContentView());
27+
}
28+
29+
/**
30+
* Wraps contentView into layout that resembles DialogWhenLarge. The layout centers
31+
* the content and dims the background to simulate a modal dialog.
32+
*/
33+
private View wrapInDialogLayout(View contentView) {
34+
ContentLayout contentLayout = new ContentLayout(this);
35+
contentLayout.addView(contentView);
36+
37+
contentLayout.setBackgroundResource(R.drawable.bg_white_dialog);
38+
39+
// We need an outer layout for two things:
40+
// * centering the content
41+
// * dimming the background
42+
FrameLayout outerLayout = new FrameLayout(this);
43+
outerLayout.addView(contentLayout,
44+
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
45+
ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER));
46+
outerLayout.setBackgroundResource(R.color.modal_dialog_scrim_color);
47+
return outerLayout;
48+
}
49+
50+
/**
51+
* Layout that sizes itself according to DialogWhenLarge constraints.
52+
*/
53+
private static class ContentLayout extends FrameLayout {
54+
private TypedValue mFixedWidthMajor = new TypedValue();
55+
private TypedValue mFixedWidthMinor = new TypedValue();
56+
private TypedValue mFixedHeightMajor = new TypedValue();
57+
private TypedValue mFixedHeightMinor = new TypedValue();
58+
59+
public ContentLayout(Context context) {
60+
super(context);
61+
fetchConstraints();
62+
}
63+
64+
/**
65+
* Wrapper around Resources.getValue() that translates Resources.NotFoundException
66+
* into false return value. Otherwise the function returns true.
67+
*/
68+
private boolean safeGetResourceValue(@AnyRes int id, TypedValue value) {
69+
try {
70+
getContext().getResources().getValue(id, value, true);
71+
return true;
72+
} catch (Resources.NotFoundException e) {
73+
return false;
74+
}
75+
}
76+
77+
private void fetchConstraints() {
78+
// Fetch size constraints. These are copies of corresponding abc_* AppCompat values,
79+
// because abc_* values are private, and even though corresponding theme attributes
80+
// are public in AppCompat (e.g. windowFixedWidthMinor), there is no guarantee that
81+
// AppCompat.DialogWhenLarge is actually defined by AppCompat and not based on
82+
// system DialogWhenLarge theme.
83+
// Note that we don't care about the return values, because onMeasure() handles null
84+
// constraints (and they will be null when the device is not considered "large").
85+
safeGetResourceValue(R.dimen.dialog_fixed_width_minor, mFixedWidthMinor);
86+
safeGetResourceValue(R.dimen.dialog_fixed_width_major, mFixedWidthMajor);
87+
safeGetResourceValue(R.dimen.dialog_fixed_height_minor, mFixedHeightMinor);
88+
safeGetResourceValue(R.dimen.dialog_fixed_height_major, mFixedHeightMajor);
89+
}
90+
91+
@Override
92+
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
93+
final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
94+
final boolean isPortrait = metrics.widthPixels < metrics.heightPixels;
95+
96+
// Constraint handling is adapted from
97+
// sdk/sources/android-25/android/support/v7/widget/ContentFrameLayout.java.
98+
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
99+
assert widthMode == MeasureSpec.AT_MOST;
100+
{
101+
final TypedValue tvw = isPortrait ? mFixedWidthMinor : mFixedWidthMajor;
102+
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
103+
if (tvw.type != TypedValue.TYPE_NULL) {
104+
assert tvw.type == TypedValue.TYPE_FRACTION;
105+
int width = (int) tvw.getFraction(metrics.widthPixels, metrics.widthPixels);
106+
widthSize = Math.min(width, widthSize);
107+
}
108+
// This either sets the width calculated from the constraints, or simply
109+
// takes all of the available space (as if MATCH_PARENT was specified).
110+
// The behavior is similar to how DialogWhenLarge windows are sized - they
111+
// are either sized by the constraints, or are full screen, but are never
112+
// sized based on the content size.
113+
widthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
114+
}
115+
116+
// This is similar to the above block that calculates width.
117+
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
118+
assert heightMode == MeasureSpec.AT_MOST;
119+
{
120+
final TypedValue tvh = isPortrait ? mFixedHeightMajor : mFixedHeightMinor;
121+
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
122+
if (tvh.type != TypedValue.TYPE_NULL) {
123+
assert tvh.type == TypedValue.TYPE_FRACTION;
124+
int height = (int) tvh.getFraction(metrics.heightPixels, metrics.heightPixels);
125+
heightSize = Math.min(height, heightSize);
126+
}
127+
heightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, MeasureSpec.EXACTLY);
128+
}
129+
130+
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
131+
}
132+
}
133+
}

0 commit comments

Comments
 (0)