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

Commit d1fd8cb

Browse files
committed
Update to 61.0.3163.100
1 parent 6bcb627 commit d1fd8cb

17 files changed

+99
-20
lines changed
0 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-
"61.0.3163.93";
11+
"61.0.3163.100";
1212
}

app/src/main/java/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public enum ChromeContextMenuItem implements ContextMenuItem {
3737
R.string.contextmenu_open_in_incognito_tab, R.id.contextmenu_open_in_incognito_tab),
3838
COPY_LINK_ADDRESS(R.drawable.ic_content_copy, R.string.contextmenu_copy_link_address,
3939
R.id.contextmenu_copy_link_address),
40+
COPY_LINK_TEXT(R.drawable.ic_content_copy, R.string.contextmenu_copy_link_text,
41+
R.id.contextmenu_copy_link_text),
4042
SAVE_LINK_AS(R.drawable.ic_file_download_white_24dp, R.string.contextmenu_save_link,
4143
R.id.contextmenu_save_link_as),
4244

app/src/main/java/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java

+25-5
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
8282
Collections.unmodifiableSet(CollectionUtil.newHashSet(
8383
ChromeContextMenuItem.COPY_LINK_ADDRESS, ChromeContextMenuItem.CALL,
8484
ChromeContextMenuItem.SEND_MESSAGE, ChromeContextMenuItem.ADD_TO_CONTACTS,
85-
ChromeContextMenuItem.COPY, ChromeContextMenuItem.LOAD_ORIGINAL_IMAGE,
86-
ChromeContextMenuItem.SAVE_LINK_AS, ChromeContextMenuItem.SAVE_IMAGE,
87-
SHARE_IMAGE, ChromeContextMenuItem.SAVE_VIDEO, SHARE_LINK));
85+
ChromeContextMenuItem.COPY, ChromeContextMenuItem.COPY_LINK_TEXT,
86+
ChromeContextMenuItem.LOAD_ORIGINAL_IMAGE, ChromeContextMenuItem.SAVE_LINK_AS,
87+
ChromeContextMenuItem.SAVE_IMAGE, SHARE_IMAGE, ChromeContextMenuItem.SAVE_VIDEO,
88+
SHARE_LINK));
8889

8990
// Items that are included for normal Chrome browser mode.
9091
private static final Set<? extends ContextMenuItem> NORMAL_MODE_WHITELIST =
@@ -118,8 +119,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
118119
private static final List<? extends ContextMenuItem> LINK_GROUP = Collections.unmodifiableList(
119120
CollectionUtil.newArrayList(ChromeContextMenuItem.OPEN_IN_OTHER_WINDOW,
120121
ChromeContextMenuItem.OPEN_IN_NEW_TAB,
121-
ChromeContextMenuItem.OPEN_IN_INCOGNITO_TAB, ChromeContextMenuItem.SAVE_LINK_AS,
122-
ChromeContextMenuItem.COPY_LINK_ADDRESS, SHARE_LINK));
122+
ChromeContextMenuItem.OPEN_IN_INCOGNITO_TAB,
123+
ChromeContextMenuItem.COPY_LINK_ADDRESS, ChromeContextMenuItem.COPY_LINK_TEXT,
124+
ChromeContextMenuItem.SAVE_LINK_AS, SHARE_LINK));
123125

124126
private static final List<? extends ContextMenuItem> IMAGE_GROUP =
125127
Collections.unmodifiableList(CollectionUtil.newArrayList(
@@ -147,6 +149,7 @@ static class ContextMenuUma {
147149
static final int ACTION_OPEN_IN_INCOGNITO_TAB = 1;
148150
static final int ACTION_COPY_LINK_ADDRESS = 2;
149151
static final int ACTION_COPY_EMAIL_ADDRESS = 3;
152+
static final int ACTION_COPY_LINK_TEXT = 4;
150153
static final int ACTION_SAVE_LINK = 5;
151154
static final int ACTION_SAVE_IMAGE = 6;
152155
static final int ACTION_OPEN_IMAGE = 7;
@@ -295,6 +298,7 @@ public List<Pair<Integer, List<ContextMenuItem>>> buildContextMenu(
295298
}
296299
} else {
297300
supportedOptions.add(ChromeContextMenuItem.COPY_LINK_ADDRESS);
301+
supportedOptions.add(ChromeContextMenuItem.COPY_LINK_TEXT);
298302
supportedOptions.add(ChromeContextMenuItem.COPY);
299303
}
300304

@@ -375,6 +379,7 @@ public List<Pair<Integer, List<ContextMenuItem>>> buildContextMenu(
375379
}
376380
}
377381
}
382+
378383
return groupedItems;
379384
}
380385

@@ -460,6 +465,10 @@ private Set<ContextMenuItem> getDisabledOptions(ContextMenuParams params) {
460465
disabledOptions.add(ChromeContextMenuItem.OPEN_IN_INCOGNITO_TAB);
461466
}
462467

468+
if (params.getLinkText().trim().isEmpty() || params.isImage()) {
469+
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_TEXT);
470+
}
471+
463472
if (params.isAnchor() && !isAcceptedScheme(params.getLinkUrl())) {
464473
disabledOptions.add(ChromeContextMenuItem.OPEN_IN_OTHER_WINDOW);
465474
disabledOptions.add(ChromeContextMenuItem.OPEN_IN_NEW_TAB);
@@ -473,6 +482,7 @@ private Set<ContextMenuItem> getDisabledOptions(ContextMenuParams params) {
473482
}
474483

475484
if (MailTo.isMailTo(params.getLinkUrl())) {
485+
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_TEXT);
476486
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_ADDRESS);
477487
if (!mDelegate.supportsSendEmailMessage()) {
478488
disabledOptions.add(ChromeContextMenuItem.SEND_MESSAGE);
@@ -483,6 +493,7 @@ private Set<ContextMenuItem> getDisabledOptions(ContextMenuParams params) {
483493
}
484494
disabledOptions.add(ChromeContextMenuItem.CALL);
485495
} else if (UrlUtilities.isTelScheme(params.getLinkUrl())) {
496+
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_TEXT);
486497
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_ADDRESS);
487498
if (!mDelegate.supportsCall()) {
488499
disabledOptions.add(ChromeContextMenuItem.CALL);
@@ -559,6 +570,10 @@ private Set<ContextMenuItem> getDisabledOptions(ContextMenuParams params) {
559570
}
560571
}
561572

573+
if (ChromeFeatureList.isEnabled(ChromeFeatureList.CUSTOM_CONTEXT_MENU)) {
574+
disabledOptions.add(ChromeContextMenuItem.COPY_LINK_TEXT);
575+
}
576+
562577
return disabledOptions;
563578
}
564579

@@ -616,6 +631,10 @@ public boolean onItemSelected(ContextMenuHelper helper, ContextMenuParams params
616631
mDelegate.onSaveToClipboard(UrlUtilities.getTelNumber(params.getLinkUrl()),
617632
ContextMenuItemDelegate.CLIPBOARD_TYPE_LINK_URL);
618633
}
634+
} else if (itemId == R.id.contextmenu_copy_link_text) {
635+
ContextMenuUma.record(params, ContextMenuUma.ACTION_COPY_LINK_TEXT);
636+
mDelegate.onSaveToClipboard(
637+
params.getLinkText(), ContextMenuItemDelegate.CLIPBOARD_TYPE_LINK_TEXT);
619638
} else if (itemId == R.id.contextmenu_save_image) {
620639
ContextMenuUma.record(params, ContextMenuUma.ACTION_SAVE_IMAGE);
621640
if (mDelegate.startDownload(params.getSrcUrl(), false)) {
@@ -663,6 +682,7 @@ public boolean onItemSelected(ContextMenuHelper helper, ContextMenuParams params
663682
} else {
664683
assert false;
665684
}
685+
666686
return true;
667687
}
668688

app/src/main/java/org/chromium/chrome/browser/omnibox/AutocompleteController.java

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.os.Bundle;
88
import android.text.TextUtils;
99

10+
import org.chromium.base.Log;
1011
import org.chromium.base.VisibleForTesting;
1112
import org.chromium.base.annotations.CalledByNative;
1213
import org.chromium.chrome.browser.WarmupManager;
@@ -23,6 +24,8 @@
2324
* Bridge to the native AutocompleteControllerAndroid.
2425
*/
2526
public class AutocompleteController {
27+
private static final String TAG = "cr_Autocomplete";
28+
2629
// Maximum number of search/history suggestions to show.
2730
private static final int MAX_DEFAULT_SUGGESTION_COUNT = 5;
2831

@@ -116,6 +119,9 @@ public void start(Profile profile, String url, String text, boolean preventInlin
116119
*/
117120
public void start(Profile profile, String url, String text, int cursorPosition,
118121
boolean preventInlineAutocomplete, boolean focusedFromFakebox) {
122+
// crbug.com/764749
123+
Log.w(TAG, "starting autocomplete controller..[%b][%b]", profile == null,
124+
TextUtils.isEmpty(url));
119125
if (profile == null || TextUtils.isEmpty(url)) return;
120126

121127
mNativeAutocompleteControllerAndroid = nativeInit(profile);
@@ -191,6 +197,8 @@ public void stop(boolean clear) {
191197
mCurrentNativeAutocompleteResult = 0;
192198
mWaitingForSuggestionsToCache = false;
193199
if (mNativeAutocompleteControllerAndroid != 0) {
200+
// crbug.com/764749
201+
Log.w(TAG, "stopping autocomplete.");
194202
nativeStop(mNativeAutocompleteControllerAndroid, clear);
195203
}
196204
}

app/src/main/java/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ private void ensureModel() {
5858

5959
if (ChromeFeatureList.isInitialized()
6060
&& ChromeFeatureList.isEnabled(ChromeFeatureList.SPANNABLE_INLINE_AUTOCOMPLETE)) {
61-
Log.i(TAG, "Using spannable model...");
61+
Log.w(TAG, "Using spannable model...");
6262
mModel = new SpannableAutocompleteEditTextModel(this);
6363
} else {
64-
Log.i(TAG, "Using non-spannable model...");
64+
Log.w(TAG, "Using non-spannable model...");
6565
mModel = new AutocompleteEditTextModel(this);
6666
}
6767
// Feed initial values.

app/src/main/java/org/chromium/chrome/browser/omnibox/AutocompleteEditTextModel.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ public void onTextChanged(CharSequence text, int start, int lengthBefore, int le
257257
if (mBatchEditNestCount == 0) {
258258
notifyAutocompleteTextStateChanged(textDeleted, true);
259259
} else {
260+
// crbug.com/764749
261+
Log.w(TAG, "onTextChanged: in batch edit");
260262
mTextDeletedInBatchMode = textDeleted;
261263
}
262264
mLastEditWasPaste = false;
@@ -421,6 +423,7 @@ public InputConnection onCreateInputConnection(InputConnection superInputConnect
421423
if (DEBUG) Log.i(TAG, "onCreateInputConnection");
422424
mLastUpdateSelStart = mDelegate.getSelectionStart();
423425
mLastUpdateSelEnd = mDelegate.getSelectionEnd();
426+
mBatchEditNestCount = 0;
424427
mInputConnection.setTarget(superInputConnection);
425428
return mInputConnection;
426429
}
@@ -430,7 +433,11 @@ private void notifyAutocompleteTextStateChanged(boolean textDeleted, boolean upd
430433
Log.i(TAG, "notifyAutocompleteTextStateChanged: DEL[%b] DIS[%b] IGN[%b]", textDeleted,
431434
updateDisplay, mIgnoreTextChangeFromAutocomplete);
432435
}
433-
if (mIgnoreTextChangeFromAutocomplete) return;
436+
if (mIgnoreTextChangeFromAutocomplete) {
437+
// crbug.com/764749
438+
Log.w(TAG, "notification ignored");
439+
return;
440+
}
434441
mLastEditWasDelete = textDeleted;
435442
mDelegate.onAutocompleteTextStateChanged(updateDisplay);
436443
// Occasionally, was seeing the selection in the URL not being cleared during

app/src/main/java/org/chromium/chrome/browser/omnibox/LocationBarLayout.java

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.chromium.base.ApiCompatibilityUtils;
5050
import org.chromium.base.CollectionUtil;
5151
import org.chromium.base.CommandLine;
52+
import org.chromium.base.Log;
5253
import org.chromium.base.VisibleForTesting;
5354
import org.chromium.base.metrics.RecordUserAction;
5455
import org.chromium.chrome.R;
@@ -107,6 +108,8 @@
107108
public class LocationBarLayout extends FrameLayout
108109
implements OnClickListener, OnSuggestionsReceivedListener, LocationBar, FakeboxDelegate,
109110
WindowAndroid.IntentCallback, FadingBackgroundView.FadingViewObserver {
111+
private static final String TAG = "cr_LocationBar";
112+
110113
// Delay triggering the omnibox results upon key press to allow the location bar to repaint
111114
// with the new characters.
112115
private static final long OMNIBOX_SUGGESTION_START_DELAY_MS = 30;
@@ -1146,6 +1149,8 @@ private void startZeroSuggest() {
11461149

11471150
@Override
11481151
public void onTextChangedForAutocomplete() {
1152+
// crbug.com/764749
1153+
Log.w(TAG, "onTextChangedForAutocomplete");
11491154
cancelPendingAutocompleteStart();
11501155

11511156
updateButtonVisibility();
@@ -1163,6 +1168,8 @@ public void onTextChangedForAutocomplete() {
11631168

11641169
stopAutocomplete(false);
11651170
if (TextUtils.isEmpty(mUrlBar.getTextWithoutAutocomplete())) {
1171+
// crbug.com/764749
1172+
Log.w(TAG, "onTextChangedForAutocomplete: url is empty");
11661173
hideSuggestions();
11671174
startZeroSuggest();
11681175
} else {
@@ -1176,6 +1183,8 @@ public void run() {
11761183

11771184
if (getCurrentTab() == null
11781185
&& (mBottomSheet == null || !mBottomSheet.isShowingNewTab())) {
1186+
// crbug.com/764749
1187+
Log.w(TAG, "onTextChangedForAutocomplete: no tab");
11791188
return;
11801189
}
11811190

app/src/main/java/org/chromium/chrome/browser/omnibox/SpannableAutocompleteEditTextModel.java

+16-3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public SpannableAutocompleteEditTextModel(AutocompleteEditTextModelBase.Delegate
8080
public InputConnection onCreateInputConnection(InputConnection inputConnection) {
8181
mLastUpdateSelStart = mDelegate.getSelectionStart();
8282
mLastUpdateSelEnd = mDelegate.getSelectionEnd();
83+
mBatchEditNestCount = 0;
8384
if (inputConnection == null) {
8485
if (DEBUG) Log.i(TAG, "onCreateInputConnection: null");
8586
mInputConnection = null;
@@ -108,8 +109,16 @@ private void notifyAutocompleteTextStateChanged() {
108109
Log.i(TAG, "notifyAutocompleteTextStateChanged PRV[%s] CUR[%s] IGN[%b]",
109110
mPreviouslyNotifiedState, mCurrentState, mIgnoreTextChangeFromAutocomplete);
110111
}
111-
if (mBatchEditNestCount > 0) return;
112-
if (mCurrentState.equals(mPreviouslyNotifiedState)) return;
112+
if (mBatchEditNestCount > 0) {
113+
// crbug.com/764749
114+
Log.w(TAG, "Did not notify - in batch edit.");
115+
return;
116+
}
117+
if (mCurrentState.equals(mPreviouslyNotifiedState)) {
118+
// crbug.com/764749
119+
Log.w(TAG, "Did not notify - no change.");
120+
return;
121+
}
113122
// Nothing has changed except that autocomplete text has been set or modified.
114123
if (mCurrentState.equalsExceptAutocompleteText(mPreviouslyNotifiedState)
115124
&& mCurrentState.hasAutocompleteText()) {
@@ -119,7 +128,11 @@ private void notifyAutocompleteTextStateChanged() {
119128
return;
120129
}
121130
mPreviouslyNotifiedState.copyFrom(mCurrentState);
122-
if (mIgnoreTextChangeFromAutocomplete) return;
131+
if (mIgnoreTextChangeFromAutocomplete) {
132+
// crbug.com/764749
133+
Log.w(TAG, "Did not notify - ignored.");
134+
return;
135+
}
123136
// The current model's mechanism always moves the cursor at the end of user text, so we
124137
// don't need to update the display.
125138
mDelegate.onAutocompleteTextStateChanged(false /* updateDisplay */);

app/src/main/java/org/chromium/chrome/browser/omnibox/UrlBar.java

+2
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@ public void onAutocompleteTextStateChanged(boolean updateDisplay) {
801801
}
802802
if (mUrlBarDelegate == null) return;
803803
if (updateDisplay) limitDisplayableLength();
804+
// crbug.com/764749
805+
Log.w(TAG, "Text change observed, triggering autocomplete.");
804806

805807
mUrlBarDelegate.onTextChangedForAutocomplete();
806808
}

app/src/main/java/org/chromium/chrome/browser/signin/SigninManager.java

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.chromium.base.ApiCompatibilityUtils;
1515
import org.chromium.base.ApplicationStatus;
1616
import org.chromium.base.Callback;
17+
import org.chromium.base.ContextUtils;
1718
import org.chromium.base.Log;
1819
import org.chromium.base.ObserverList;
1920
import org.chromium.base.Promise;
@@ -24,6 +25,7 @@
2425
import org.chromium.base.metrics.RecordUserAction;
2526
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
2627
import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
28+
import org.chromium.chrome.browser.sync.SyncController;
2729
import org.chromium.chrome.browser.sync.SyncUserDataWiper;
2830
import org.chromium.components.signin.AccountManagerFacade;
2931
import org.chromium.components.signin.ChromeSigninController;
@@ -339,6 +341,11 @@ public void onSystemAccountsChanged() {
339341
*/
340342
public void signIn(
341343
Account account, @Nullable Activity activity, @Nullable SignInCallback callback) {
344+
// TODO(https://crbug.com/761476): remove this as soon as race condition in Sync is fixed.
345+
// SyncController has a race condition inside so it needs to be initialized before actually
346+
// signin in.
347+
SyncController.get(ContextUtils.getApplicationContext());
348+
342349
if (account == null) {
343350
Log.w(TAG, "Ignoring sign-in request due to null account.");
344351
if (callback != null) callback.onSignInAborted();

app/src/main/java/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java

+8
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,14 @@ public boolean isSheetOpen() {
13791379
*/
13801380
private void setInternalCurrentState(@SheetState int state) {
13811381
if (state == mCurrentState) return;
1382+
1383+
// TODO(mdjones): This shouldn't be able to happen, but does occasionally during layout.
1384+
// Fix the race condition that is making this happen.
1385+
if (state == SHEET_STATE_NONE) {
1386+
setSheetState(getTargetSheetState(getSheetOffsetFromBottom(), 0), false);
1387+
return;
1388+
}
1389+
13821390
mCurrentState = state;
13831391

13841392
for (BottomSheetObserver o : mObservers) {
0 Bytes
Binary file not shown.

app/src/main/res/values-zh-rCN/android_chrome_strings.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@
514514
<string name="contextmenu_copy">"复制"</string>
515515
<string name="contextmenu_send_message">"发送消息"</string>
516516
<string name="contextmenu_add_to_contacts">"添加到通讯录"</string>
517-
<string name="contextmenu_copy_link_address">"复制链接"</string>
518-
<string name="contextmenu_save_link">"下载网页"</string>
517+
<string name="contextmenu_copy_link_address">"复制链接地址"</string>
518+
<string name="contextmenu_copy_link_text">"复制链接文字"</string>
519+
<string name="contextmenu_save_link">"下载链接"</string>
519520
<string name="contextmenu_save_image">"下载图片"</string>
520521
<string name="contextmenu_open_image">"打开图片"</string>
521522
<string name="contextmenu_open_image_in_new_tab">"在新标签页中打开图片"</string>

app/src/main/res/values-zh-rTW/android_chrome_strings.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@
514514
<string name="contextmenu_copy">"複製"</string>
515515
<string name="contextmenu_send_message">"傳送訊息"</string>
516516
<string name="contextmenu_add_to_contacts">"新增為聯絡人"</string>
517-
<string name="contextmenu_copy_link_address">"複製連結"</string>
518-
<string name="contextmenu_save_link">"下載網頁"</string>
517+
<string name="contextmenu_copy_link_address">"複製連結網址"</string>
518+
<string name="contextmenu_copy_link_text">"複製連結文字"</string>
519+
<string name="contextmenu_save_link">"下載連結"</string>
519520
<string name="contextmenu_save_image">"下載圖片"</string>
520521
<string name="contextmenu_open_image">"開啟圖片"</string>
521522
<string name="contextmenu_open_image_in_new_tab">"在新分頁中開啟圖片"</string>

app/src/main/res/values/android_chrome_strings.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ To obtain new licenses, connect to the internet and play your downloaded content
514514
<string name="contextmenu_copy">"Copy"</string>
515515
<string name="contextmenu_send_message">"Send message"</string>
516516
<string name="contextmenu_add_to_contacts">"Add to contacts"</string>
517-
<string name="contextmenu_copy_link_address">"Copy link"</string>
518-
<string name="contextmenu_save_link">"Download page"</string>
517+
<string name="contextmenu_copy_link_address">"Copy link address"</string>
518+
<string name="contextmenu_copy_link_text">"Copy link text"</string>
519+
<string name="contextmenu_save_link">"Download link"</string>
519520
<string name="contextmenu_save_image">"Download image"</string>
520521
<string name="contextmenu_open_image">"Open image"</string>
521522
<string name="contextmenu_open_image_in_new_tab">"Open image in new tab"</string>

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ext {
2828
minSdkVersion = 19
2929
targetSdkVersion = 23
3030

31-
versionCode = 3
32-
versionName = "61.0.3163.93"
31+
versionCode = 4
32+
versionName = "61.0.3163.100"
3333

3434
supportLibraryVersion = "26.0.0-alpha1"
3535
playServicesVersion = "10.2.6"

0 commit comments

Comments
 (0)