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

Commit 39aee8d

Browse files
committed
Update to 63.0.3239.30
1 parent 0e7155e commit 39aee8d

File tree

47 files changed

+590
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+590
-270
lines changed

app/src/main/assets/en-US.pak

0 Bytes
Binary file not shown.

app/src/main/assets/resources.pak

685 Bytes
Binary file not shown.

app/src/main/assets/zh-CN.pak

16 Bytes
Binary file not shown.

app/src/main/assets/zh-TW.pak

1 Byte
Binary file not shown.

app/src/main/java/org/chromium/base/ResourceExtractor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ResourceExtractor {
2626
private static final String TAG = "base";
2727
private static final String ICU_DATA_FILENAME = "icudtl.dat";
2828
private static final String V8_NATIVES_DATA_FILENAME = "natives_blob.bin";
29-
private static final String V8_SNAPSHOT_DATA_FILENAME = "snapshot_blob.bin";
29+
private static final String V8_SNAPSHOT_DATA_FILENAME = "snapshot_blob_32.bin";
3030
private static final String FALLBACK_LOCALE = "en-US";
3131

3232
private class ExtractTask extends AsyncTask<Void, Void, Void> {

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.18";
11+
"63.0.3239.30";
1212
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public Bitmap getBitmap(String pageUrl, Bitmap largestFavicon) {
6464
}
6565

6666
if (mGenerator == null) {
67-
mGenerator = new RoundedIconGenerator(mContext, APP_ICON_SIZE_DP, APP_ICON_SIZE_DP,
68-
APP_ICON_CORNER_RADIUS_DP, APP_ICON_DEFAULT_BACKGROUND_COLOR,
67+
mGenerator = new RoundedIconGenerator(mContext.getResources(), APP_ICON_SIZE_DP,
68+
APP_ICON_SIZE_DP, APP_ICON_CORNER_RADIUS_DP, APP_ICON_DEFAULT_BACKGROUND_COLOR,
6969
APP_ICON_TEXT_SIZE_DP);
7070
}
7171

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

-7
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ public abstract class ChromeSwitches {
8181
*/
8282
public static final String DISABLE_TAB_MERGING_FOR_TESTING = "disable-tab-merging";
8383

84-
/**
85-
* Force-enable partner customization for testing.
86-
* Partner customization includes configurations from PartnerBookmarksProvider and
87-
* PartnerBrowserCustomizations.
88-
*/
89-
public static final String ALLOW_PARTNER_CUSTOMIZATION = "allow-partner-customization";
90-
9184
///////////////////////////////////////////////////////////////////////////////////////////////
9285
// Native Switches
9386
///////////////////////////////////////////////////////////////////////////////////////////////

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.18";
9+
static final String PRODUCT_VERSION = "63.0.3239.30";
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/bookmarks/BookmarkActionBar.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public BookmarkActionBar(Context context, AttributeSet attrs) {
5252
.setTitle(R.string.bookmark_action_bar_move);
5353
getMenu().findItem(R.id.selection_mode_delete_menu_id)
5454
.setTitle(R.string.bookmark_action_bar_delete);
55+
56+
// Wait to enable the selection mode group until the BookmarkDelegate is set. The
57+
// SelectionDelegate is retrieved from the BookmarkDelegate.
58+
getMenu().setGroupEnabled(R.id.selection_mode_menu_group, false);
5559
}
5660

5761
@Override
@@ -68,7 +72,6 @@ public void onNavigationBack() {
6872
public boolean onMenuItemClick(MenuItem menuItem) {
6973
hideOverflowMenu();
7074

71-
SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
7275
if (menuItem.getItemId() == R.id.edit_menu_id) {
7376
BookmarkAddEditFolderActivity.startEditFolderActivity(getContext(),
7477
mCurrentFolder.getId());
@@ -79,7 +82,10 @@ public boolean onMenuItemClick(MenuItem menuItem) {
7982
} else if (menuItem.getItemId() == R.id.search_menu_id) {
8083
mDelegate.openSearchUI();
8184
return true;
82-
} else if (menuItem.getItemId() == R.id.selection_mode_edit_menu_id) {
85+
}
86+
87+
SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
88+
if (menuItem.getItemId() == R.id.selection_mode_edit_menu_id) {
8389
List<BookmarkId> list = selectionDelegate.getSelectedItems();
8490
assert list.size() == 1;
8591
BookmarkItem item = mDelegate.getModel().getBookmarkById(list.get(0));
@@ -131,10 +137,14 @@ public void onBookmarkDelegateInitialized(BookmarkDelegate delegate) {
131137
mDelegate.addUIObserver(this);
132138
if (!delegate.isDialogUi()) getMenu().removeItem(R.id.close_menu_id);
133139
delegate.getModel().addObserver(mBookmarkModelObserver);
140+
141+
getMenu().setGroupEnabled(R.id.selection_mode_menu_group, true);
134142
}
135143

136144
@Override
137145
public void onDestroy() {
146+
if (mDelegate == null) return;
147+
138148
mDelegate.removeUIObserver(this);
139149
mDelegate.getModel().removeObserver(mBookmarkModelObserver);
140150
}

app/src/main/java/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java

+8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
package org.chromium.chrome.browser.bookmarks;
66

77
import android.content.Context;
8+
import android.content.res.ColorStateList;
89
import android.util.AttributeSet;
910

11+
import org.chromium.base.ApiCompatibilityUtils;
1012
import org.chromium.chrome.R;
1113
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem;
1214
import org.chromium.components.bookmarks.BookmarkId;
@@ -47,4 +49,10 @@ BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
4749
: getResources().getString(R.string.no_bookmarks));
4850
return item;
4951
}
52+
53+
@Override
54+
protected ColorStateList getDefaultIconTint() {
55+
return ApiCompatibilityUtils.getColorStateList(
56+
getResources(), BookmarkUtils.getFolderIconTint());
57+
}
5058
}

app/src/main/java/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,14 @@ public static boolean openBookmark(BookmarkModel model, Activity activity,
271271
public static TintedDrawable getFolderIcon(Resources res) {
272272
// TODO(twellington): Update tinting to 65% black to match mocks.
273273
return TintedDrawable.constructTintedDrawable(
274-
res, R.drawable.ic_folder_blue_24dp, R.color.dark_mode_tint);
274+
res, R.drawable.ic_folder_blue_24dp, getFolderIconTint());
275+
}
276+
277+
/**
278+
* @return The tint used on the bookmark folder icon.
279+
*/
280+
public static int getFolderIconTint() {
281+
return R.color.dark_mode_tint;
275282
}
276283

277284
private static void openUrl(Activity activity, String url, ComponentName componentName) {

app/src/main/java/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelAnimation.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package org.chromium.chrome.browser.compositor.bottombar;
66

77
import android.animation.Animator;
8-
import android.animation.AnimatorListenerAdapter;
98
import android.content.Context;
109

1110
import org.chromium.base.VisibleForTesting;
@@ -16,6 +15,7 @@
1615
import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason;
1716
import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost;
1817
import org.chromium.chrome.browser.util.MathUtils;
18+
import org.chromium.chrome.browser.widget.animation.CancelAwareAnimatorListener;
1919

2020
/**
2121
* Base abstract class for animating the Overlay Panel.
@@ -353,9 +353,9 @@ public void onAnimationUpdate(CompositorAnimator animator) {
353353
setPanelHeight(animator.getAnimatedValue());
354354
}
355355
});
356-
mHeightAnimator.addListener(new AnimatorListenerAdapter() {
356+
mHeightAnimator.addListener(new CancelAwareAnimatorListener() {
357357
@Override
358-
public void onAnimationEnd(Animator animation) {
358+
public void onEnd(Animator animation) {
359359
onHeightAnimationFinished();
360360
}
361361
});

app/src/main/java/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchQuickActionControl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private void resolveIntent() {
291291

292292
Resources res = mContext.getResources();
293293
if (mToolbarBackgroundColor != 0
294-
&& ColorUtils.isUsingDefaultToolbarColor(res,
294+
&& !ColorUtils.isUsingDefaultToolbarColor(res,
295295
FeatureUtilities.isChromeHomeEnabled(), false,
296296
mToolbarBackgroundColor)
297297
&& ColorUtils.shouldUseLightForegroundOnBackground(

app/src/main/java/org/chromium/chrome/browser/download/DownloadBroadcastManager.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public void finishNativeInitialization() {
194194
@VisibleForTesting
195195
void propagateInteraction(Intent intent) {
196196
String action = intent.getAction();
197+
DownloadNotificationUmaHelper.recordNotificationInteractionHistogram(action);
197198
final ContentId id = getContentIdFromIntent(intent);
198199

199200
// Handle actions that do not require a specific entry or service delegate.
@@ -217,7 +218,6 @@ void propagateInteraction(Intent intent) {
217218

218219
Preconditions.checkNotNull(downloadServiceDelegate);
219220
Preconditions.checkNotNull(id);
220-
Preconditions.checkNotNull(entry);
221221

222222
// Handle all remaining actions.
223223
switch (action) {
@@ -230,8 +230,14 @@ void propagateInteraction(Intent intent) {
230230
break;
231231

232232
case ACTION_DOWNLOAD_RESUME:
233-
downloadServiceDelegate.resumeDownload(
234-
id, entry.buildDownloadItem(), true /* hasUserGesture */);
233+
DownloadItem item = (entry != null)
234+
? entry.buildDownloadItem()
235+
: new DownloadItem(false,
236+
new DownloadInfo.Builder()
237+
.setDownloadGuid(id.id)
238+
.setIsOffTheRecord(isOffTheRecord)
239+
.build());
240+
downloadServiceDelegate.resumeDownload(id, item, true /* hasUserGesture */);
235241
break;
236242

237243
default:

app/src/main/java/org/chromium/chrome/browser/download/DownloadBroadcastReceiver.java

+1-58
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44

55
package org.chromium.chrome.browser.download;
66

7-
import android.app.DownloadManager;
87
import android.content.BroadcastReceiver;
98
import android.content.Context;
109
import android.content.Intent;
11-
import android.net.Uri;
12-
13-
import org.chromium.chrome.browser.notifications.NotificationConstants;
14-
import org.chromium.chrome.browser.util.IntentUtils;
15-
import org.chromium.components.offline_items_collection.ContentId;
1610

1711
/**
1812
* This {@link BroadcastReceiver} handles clicks to download notifications and their action buttons.
@@ -24,58 +18,7 @@
2418
public class DownloadBroadcastReceiver extends BroadcastReceiver {
2519
@Override
2620
public void onReceive(final Context context, Intent intent) {
27-
String action = intent.getAction();
28-
switch (action) {
29-
case DownloadManager.ACTION_NOTIFICATION_CLICKED:
30-
openDownload(context, intent);
31-
break;
32-
case DownloadNotificationService.ACTION_DOWNLOAD_RESUME:
33-
case DownloadNotificationService.ACTION_DOWNLOAD_CANCEL:
34-
case DownloadNotificationService.ACTION_DOWNLOAD_PAUSE:
35-
case DownloadNotificationService.ACTION_DOWNLOAD_OPEN:
36-
case DownloadNotificationService.ACTION_DOWNLOAD_UPDATE_SUMMARY_ICON:
37-
performDownloadOperation(context, intent);
38-
break;
39-
default:
40-
break;
41-
}
42-
}
43-
44-
/**
45-
* Called to open a particular download item. Falls back to opening Download Home.
46-
* @param context Context of the receiver.
47-
* @param intent Intent from the android DownloadManager.
48-
*/
49-
private void openDownload(final Context context, Intent intent) {
50-
int notificationId = IntentUtils.safeGetIntExtra(
51-
intent, NotificationConstants.EXTRA_NOTIFICATION_ID, -1);
52-
DownloadNotificationService.hideDanglingSummaryNotification(context, notificationId);
53-
54-
long ids[] =
55-
intent.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS);
56-
if (ids == null || ids.length == 0) {
57-
DownloadManagerService.openDownloadsPage(context);
58-
return;
59-
}
60-
61-
long id = ids[0];
62-
Uri uri = DownloadManagerDelegate.getContentUriFromDownloadManager(context, id);
63-
if (uri == null) {
64-
DownloadManagerService.openDownloadsPage(context);
65-
return;
66-
}
67-
68-
String downloadFilename = IntentUtils.safeGetStringExtra(
69-
intent, DownloadNotificationService.EXTRA_DOWNLOAD_FILE_PATH);
70-
boolean isSupportedMimeType = IntentUtils.safeGetBooleanExtra(
71-
intent, DownloadNotificationService.EXTRA_IS_SUPPORTED_MIME_TYPE, false);
72-
boolean isOffTheRecord = IntentUtils.safeGetBooleanExtra(
73-
intent, DownloadNotificationService.EXTRA_IS_OFF_THE_RECORD, false);
74-
String originalUrl = IntentUtils.safeGetStringExtra(intent, Intent.EXTRA_ORIGINATING_URI);
75-
String referrer = IntentUtils.safeGetStringExtra(intent, Intent.EXTRA_REFERRER);
76-
ContentId contentId = DownloadNotificationService.getContentIdFromIntent(intent);
77-
DownloadManagerService.openDownloadedContent(context, downloadFilename, isSupportedMimeType,
78-
isOffTheRecord, contentId.id, id, originalUrl, referrer);
21+
performDownloadOperation(context, intent);
7922
}
8023

8124
/**

app/src/main/java/org/chromium/chrome/browser/download/DownloadForegroundService.java

+37
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package org.chromium.chrome.browser.download;
66

7+
import static org.chromium.chrome.browser.download.DownloadSnackbarController.INVALID_NOTIFICATION_ID;
8+
79
import android.app.Notification;
810
import android.app.Service;
911
import android.content.Context;
@@ -20,6 +22,8 @@
2022
*/
2123
public class DownloadForegroundService extends Service {
2224
private final IBinder mBinder = new LocalBinder();
25+
// Only tracking for UMA purposes.
26+
private int mPinnedNotification = INVALID_NOTIFICATION_ID;
2327

2428
/**
2529
* Start the foreground service with this given context.
@@ -41,12 +45,31 @@ public void startOrUpdateForegroundService(int notificationId, Notification noti
4145
}
4246

4347
startForeground(notificationId, notification);
48+
49+
// Record when starting foreground and when updating pinned notification.
50+
if (mPinnedNotification == INVALID_NOTIFICATION_ID) {
51+
DownloadNotificationUmaHelper.recordForegroundServiceLifecycleHistogram(
52+
DownloadNotificationUmaHelper.ForegroundLifecycle.START);
53+
} else {
54+
if (mPinnedNotification != notificationId) {
55+
DownloadNotificationUmaHelper.recordForegroundServiceLifecycleHistogram(
56+
DownloadNotificationUmaHelper.ForegroundLifecycle.UPDATE);
57+
}
58+
}
59+
mPinnedNotification = notificationId;
4460
}
4561

4662
/**
4763
* Stop the foreground service that is running.
4864
*/
4965
public void stopDownloadForegroundService(boolean isCancelled) {
66+
// Record when stopping foreground.
67+
DownloadNotificationUmaHelper.recordForegroundServiceLifecycleHistogram(
68+
DownloadNotificationUmaHelper.ForegroundLifecycle.STOP);
69+
DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
70+
DownloadNotificationUmaHelper.ServiceStopped.STOPPED, true /* withForeground */);
71+
mPinnedNotification = INVALID_NOTIFICATION_ID;
72+
5073
// If it's not cancelled, just detach the notification from the service, if possible.
5174
if (!isCancelled && Build.VERSION.SDK_INT >= 24) {
5275
stopForeground(STOP_FOREGROUND_DETACH);
@@ -61,6 +84,9 @@ public void stopDownloadForegroundService(boolean isCancelled) {
6184
public int onStartCommand(Intent intent, int flags, int startId) {
6285
// In the case the service was restarted when the intent is null.
6386
if (intent == null) {
87+
DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
88+
DownloadNotificationUmaHelper.ServiceStopped.START_STICKY, true);
89+
6490
DownloadForegroundServiceObservers.alertObserversServiceRestarted();
6591

6692
// Allow observers to restart service on their own, if needed.
@@ -73,16 +99,27 @@ public int onStartCommand(Intent intent, int flags, int startId) {
7399

74100
@Override
75101
public void onDestroy() {
102+
DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
103+
DownloadNotificationUmaHelper.ServiceStopped.DESTROYED, true /* withForeground */);
76104
DownloadForegroundServiceObservers.alertObserversServiceDestroyed();
77105
super.onDestroy();
78106
}
79107

80108
@Override
81109
public void onTaskRemoved(Intent rootIntent) {
110+
DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
111+
DownloadNotificationUmaHelper.ServiceStopped.TASK_REMOVED, true /*withForeground*/);
82112
DownloadForegroundServiceObservers.alertObserversTaskRemoved();
83113
super.onTaskRemoved(rootIntent);
84114
}
85115

116+
@Override
117+
public void onLowMemory() {
118+
DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
119+
DownloadNotificationUmaHelper.ServiceStopped.LOW_MEMORY, true /* withForeground */);
120+
super.onLowMemory();
121+
}
122+
86123
@Nullable
87124
@Override
88125
public IBinder onBind(Intent intent) {

0 commit comments

Comments
 (0)