Commit 73728ffb authored by Romain Hunault's avatar Romain Hunault
Browse files

Merge branch 'backlog_3405-all-upstream' into 'master'

Upstream Browser and BrowserWebView to Bromite v91.0.4472.143

See merge request e/apps/browser!36
parents 4ea6394b ee3e4bad
Pipeline #127446 passed with stages
in 377 minutes and 28 seconds
......@@ -57,12 +57,13 @@ Yes/No
### Is the bug a crash?
<!--
If yes then individuate and post the 'adb logcat | grep chromium' dump, otherwise remove this section.
-->
No
-- or --
Yes, this is the crash dump:
```
<paste here logcat dump>
<paste here logcat dump individuated with 'adb logcat | grep chromium'>
```
### Describe the bug
......
# 91.0.4472.158
* added x64 releases
# 91.0.4472.146
* removed flags for device motion/orientation (fixes https://github.com/bromite/bromite/issues/1204)
* prevent crash on download on API level 21 (fixes https://github.com/bromite/bromite/issues/1184)
* fix crash reporting garbled UI for small screens (thanks to @uazo, https://github.com/bromite/bromite/pull/1236)
* add flag to enable/disable vibration API (fixes https://github.com/bromite/bromite/issues/1045)
# 91.0.4472.143
* add support for ISupportHelpAndFeedback
* JIT-less toggle (fixes https://github.com/bromite/bromite/issues/1235)
* enable crash reporting UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/944)
# 91.0.4472.102
* fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154)
* allow saving pages in incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182)
# 91.0.4472.97
* add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152)
* enable IntentBlockExternalFormRedirectsNoGesture by default
* add flag to disable external intent requests
* fix for tab collection temporary/non-exportable (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1138)
# 91.0.4472.50
* unexpire tab group flags `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
* replace known good hostname used for DoH test (fixes https://github.com/bromite/bromite/issues/1148)
......
91.0.4472.50
91.0.4472.158
......@@ -45,7 +45,6 @@ Open-YouTube-links-in-Bromite.patch
Add-exit-menu-item.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Multiple-fingerprinting-mitigations.patch
Add-flags-to-disable-device-motion-orientation-APIs.patch
Disable-metrics-on-all-I-O-threads.patch
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
Add-flag-to-configure-maximum-connections-per-host.patch
......@@ -143,4 +142,12 @@ Add-IsCleartextPermitted-flag.patch
Disable-RTCGetCurrentBrowsingContextMedia-by-default.patch
Disable-FLoC-by-default.patch
Unexpire-tab-groups-flags.patch
Add-flag-for-omnibox-autocomplete-filtering.patch
Enable-IntentBlockExternalFormRedirectsNoGesture-by-default.patch
Add-flag-to-disable-external-intent-requests.patch
Logcat-crash-reports-UI.patch
Add-support-for-ISupportHelpAndFeedback.patch
JIT-less-toggle.patch
API-level-21-prevent-crash-on-download.patch
Add-vibration-flag.patch
Automated-domain-substitution.patch
......@@ -82,7 +82,7 @@ diff --git a/base/android/android_image_reader_compat.h b/base/android/android_i
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1935,7 +1935,7 @@
@@ -1940,7 +1940,7 @@
{
"name": "enable-image-reader",
"owners": [ "vikassoni", "liberato" ],
......@@ -225,7 +225,7 @@ diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -619,6 +619,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
@@ -627,6 +627,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
const base::Feature kMediaDrmPreprovisioningAtStartup{
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
......
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 16:53:48 +0200
Subject: API level 21: prevent crash on download
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
This patch ignores boolean settings for them and prevents the crash.
See also: https://github.com/bromite/bromite/issues/1184
---
.../internal/BundleToPersistableBundleConverter.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -85,9 +85,17 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);
} else if (obj instanceof Boolean) {
- persistableBundle.putBoolean(key, (Boolean) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBoolean(key, (Boolean) obj);
+ }
} else if (obj instanceof boolean[]) {
- persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ }
} else if (obj instanceof Double) {
persistableBundle.putDouble(key, (Double) obj);
} else if (obj instanceof double[]) {
--
2.17.1
......@@ -99,7 +99,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
&kAddToHomescreenIPH,
&kAllowNewIncognitoTabIntents,
&kAllowRemoteContextForNotifications,
@@ -333,6 +334,9 @@ const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) {
@@ -334,6 +335,9 @@ const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) {
// Alphabetical:
......
......@@ -14,7 +14,7 @@ Subject: Add IsCleartextPermitted flag
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7359,6 +7359,11 @@ const FeatureEntry kFeatureEntries[] = {
@@ -7358,6 +7358,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
chrome::android::kBookmarksExportUseSaf)},
......@@ -29,7 +29,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1386,6 +1386,10 @@ const char kHostedAppShimCreationName[] =
@@ -1384,6 +1384,10 @@ const char kHostedAppShimCreationName[] =
const char kHostedAppShimCreationDescription[] =
"Create app shims on Mac when creating a hosted app.";
......@@ -43,7 +43,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -817,6 +817,9 @@ extern const char kHostedAppQuitNotificationDescription[];
@@ -814,6 +814,9 @@ extern const char kHostedAppQuitNotificationDescription[];
extern const char kHostedAppShimCreationName[];
extern const char kHostedAppShimCreationDescription[];
......
......@@ -17,7 +17,7 @@ See also:
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3105,6 +3105,12 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3099,6 +3099,12 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kDeprecateLowUsageCodecsName,
flag_descriptions::kDeprecateLowUsageCodecsDescription, kOsCrOS | kOsLinux,
FEATURE_VALUE_TYPE(media::kDeprecateLowUsageCodecs)},
......@@ -33,7 +33,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -605,6 +605,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
@@ -611,6 +611,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
"authenticator (if available) to verify card ownership when retrieving "
"credit cards from Google Payments.";
......@@ -48,7 +48,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -369,6 +369,9 @@ extern const char kEnableAutofillAddressSavePromptDescription[];
@@ -372,6 +372,9 @@ extern const char kEnableAutofillAddressSavePromptDescription[];
extern const char kEnableAutofillCreditCardAblationExperimentDisplayName[];
extern const char kEnableAutofillCreditCardAblationExperimentDescription[];
......@@ -62,7 +62,7 @@ diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmp
--- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
+++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
@@ -147,10 +147,6 @@ public abstract class ChromeSwitches {{
/** Switch for enabling the Chrome Survey. */
/** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */
public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey";
- /** Switch to enable incognito tabs to be seen in Android Recents. */
......
......@@ -81,15 +81,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -342,6 +342,8 @@ std::vector<std::u16string> ChromeAutocompleteProviderClient::GetBuiltinURLs() {
std::vector<std::u16string>
ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
std::vector<std::u16string> builtins_to_provide;
@@ -350,6 +350,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
#endif
+ builtins_to_provide.push_back(
+ base::ASCIIToUTF16(chrome::kChromeUIProxyConfigURL));
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL));
#if !defined(OS_ANDROID)
base::ASCIIToUTF16(chrome::kChromeUIVersionURL));
return builtins_to_provide;
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
......
......@@ -10,10 +10,10 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
chrome/android/chrome_java_sources.gni | 1 +
.../java/res/xml/privacy_preferences.xml | 5 ++
.../AlwaysIncognitoLinkInterceptor.java | 80 +++++++++++++++++++
.../chrome/browser/ChromeTabbedActivity.java | 8 +-
.../chrome/browser/ChromeTabbedActivity.java | 6 +-
.../chrome/browser/app/ChromeActivity.java | 4 +
.../AppMenuPropertiesDelegateImpl.java | 6 ++
.../ChromeContextMenuPopulator.java | 28 +++++--
.../ChromeContextMenuPopulator.java | 9 ++-
.../CustomTabActivityLifecycleUmaTracker.java | 25 ------
.../CustomTabIntentDataProvider.java | 5 +-
.../browser/init/StartupTabPreloader.java | 14 +++-
......@@ -23,7 +23,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
.../webapps/WebappIntentDataProvider.java | 14 ++++
.../flags/android/chrome_feature_list.cc | 2 +-
.../strings/android_chrome_strings.grd | 7 ++
16 files changed, 187 insertions(+), 39 deletions(-)
16 files changed, 171 insertions(+), 34 deletions(-)
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
......@@ -140,15 +140,15 @@ new file mode 100644
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -58,6 +58,7 @@ import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskTraits;
@@ -57,6 +57,7 @@ import org.chromium.base.supplier.UnownedUserDataSupplier;
import org.chromium.base.task.PostTask;
import org.chromium.cc.input.BrowserControlsState;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout;
@@ -1696,8 +1697,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
@@ -1695,8 +1696,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
Bundle savedInstanceState = getSavedInstanceState();
// We determine the model as soon as possible so every systems get initialized coherently.
......@@ -160,15 +160,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
int index = savedInstanceState != null ? savedInstanceState.getInt(WINDOW_INDEX, 0) : 0;
mNextTabPolicySupplier = new ChromeNextTabPolicySupplier(mOverviewModeBehaviorSupplier);
@@ -1715,7 +1717,7 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
public void onTabStateInitialized() {
if (!mCreatedTabOnStartup) return;
- TabModel model = mTabModelSelectorImpl.getModel(false);
+ TabModel model = mTabModelSelectorImpl.getModel(startIncognito);
TasksUma.recordTasksUma(model);
}
});
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
......@@ -219,49 +210,34 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr
import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator;
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item;
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator.ContextMenuUma.Action;
@@ -332,6 +334,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
params.getLinkUrl().getSpec());
}
@@ -336,6 +338,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
boolean hasSaveImage = false;
mShowEphemeralTabNewLabel = null;
+ /**
+ * Disallow opening in a new tab when in always-incognito mode.
+ */
+ private static boolean canOpenNewTab() {
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)
+ /*&& !mItemDelegate.isIncognito()*/) {
+ return false;
+ }
+ return true;
+ }
+ boolean always_incognito =
+ ContextUtils.getAppSharedPreferences().getBoolean(
+ AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
+
+
@Override
public List<Pair<Integer, ModelList>> buildContextMenu() {
boolean hasSaveImage = false;
@@ -345,14 +359,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
&& UrlUtilities.isAcceptedScheme(mParams.getUrl().getSpec())) {
if (mMode == ContextMenuMode.NORMAL) {
if (TabUiFeatureUtilities.ENABLE_TAB_GROUP_AUTO_CREATION.getValue()) {
- linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
+ if (canOpenNewTab()) linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
} else {
if (TabUiFeatureUtilities.showContextMenuOpenNewTabInGroupItemFirst()) {
- linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
- linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
+ if (canOpenNewTab()) {
+ linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
+ linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
+ }
} else {
- linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
- linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
+ if (canOpenNewTab()) {
+ linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB));
+ linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
+ }
List<Pair<Integer, ModelList>> groupedItems = new ArrayList<>();
if (mParams.isAnchor()) {
@@ -354,6 +360,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
}
}
+
if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) {
linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB));
}
@@ -376,7 +383,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
}
}
if (FirstRunStatus.getFirstRunFlowComplete()) {
- if (!mItemDelegate.isIncognito()
+ if ((always_incognito || !mItemDelegate.isIncognito())
&& UrlUtilities.isDownloadableScheme(mParams.getLinkUrl())) {
linkGroup.add(createListItem(Item.SAVE_LINK_AS));
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
......
......@@ -738,7 +738,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7309,6 +7309,12 @@ const FeatureEntry kFeatureEntries[] = {
@@ -7308,6 +7308,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kDesktopPWAsAppIconShortcutsMenuUI)},
#endif
......@@ -1257,7 +1257,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -5224,6 +5224,11 @@ const char kWebrtcPipeWireCapturerDescription[] =
@@ -5222,6 +5222,11 @@ const char kWebrtcPipeWireCapturerDescription[] =
"capturing the desktop content on the Wayland display server.";
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
......@@ -1272,7 +1272,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -3066,6 +3066,9 @@ extern const char kWebrtcPipeWireCapturerName[];
@@ -3063,6 +3063,9 @@ extern const char kWebrtcPipeWireCapturerName[];
extern const char kWebrtcPipeWireCapturerDescription[];
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
......@@ -1396,14 +1396,14 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro
/**
* Whether Chrome is set as the default browser.
@@ -973,6 +975,7 @@ public final class ChromePreferenceKeys {
@@ -976,6 +978,7 @@ public final class ChromePreferenceKeys {
AUTOFILL_ASSISTANT_PROACTIVE_HELP,
APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE,
APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO,
+ BOOKMARKS_LAST_EXPORT_URI,
APPLICATION_OVERRIDE_LANGUAGE,
CHROME_SURVEY_DOWNLOAD_ATTEMPTS.pattern(),
CHROME_SURVEY_PROMPT_DISPLAYED_TIMESTAMP.pattern(),
CLIPBOARD_SHARED_URI,
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
......
......@@ -37,7 +37,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -196,6 +196,8 @@ import java.lang.annotation.RetentionPolicy;
@@ -195,6 +195,8 @@ import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.Locale;
......@@ -46,7 +46,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
/**
* This is the main activity for ChromeMobile when not running in document mode. All the tabs
* are accessible via a chrome specific tab switching UI.
@@ -1901,6 +1903,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
@@ -1900,6 +1902,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
} else if (id == R.id.close_tab) {
getCurrentTabModel().closeTab(currentTab, true, false, true);
RecordUserAction.record("MobileTabClosed");
......
From: Blaise <BlaiseD@GMail.com>
Date: Sat, 22 Aug 2020 08:52:40 -0500
Subject: Add flag for omnibox autocomplete filtering
Adds a flag that restricts whether search history, clipboard, bookmarks
and internal chrome:// pages will be used for the autocomplete results.
---
chrome/browser/about_flags.cc | 21 +++++++++++++++++++
.../browser/autocomplete_controller.cc | 10 +++++++++
.../omnibox/browser/history_url_provider.cc | 3 +++
components/omnibox/browser/search_provider.cc | 4 ++++
components/url_formatter/url_fixer.cc | 3 +++
5 files changed, 41 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -503,6 +503,22 @@ const FeatureEntry::FeatureVariation kAdaptiveButtonInTopToolbarVariations[] = {
};
#endif // OS_ANDROID
+const FeatureEntry::Choice kOmniboxAutocompleteFiltering[] = {
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
+ {"Search suggestions only",
+ "omnibox-autocomplete-filtering",
+ "search"},
+ {"Search suggestions and bookmarks",
+ "omnibox-autocomplete-filtering",
+ "search-bookmarks"},
+ {"Search suggestions and internal chrome pages",
+ "omnibox-autocomplete-filtering",
+ "search-chrome"},
+ {"Search suggestions, bookmarks, and internal chrome pages",
+ "omnibox-autocomplete-filtering",
+ "search-bookmarks-chrome"},
+};
+
#if defined(OS_ANDROID)
const FeatureEntry::FeatureParam kHideDismissButton[] = {
{"dismiss_button", "hide"}};
@@ -4769,6 +4785,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
#endif // !defined(OS_ANDROID)
+ {"omnibox-autocomplete-filtering",
+ "Omnibox Autocomplete Filtering",
+ "Restrict omnibox autocomplete results to a combination of search suggestions (if enabled), bookmarks, and internal chrome pages. ungoogled-chromium flag.",
+ kOsAll, MULTI_VALUE_TYPE(kOmniboxAutocompleteFiltering)},
+
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
{"direct-manipulation-stylus",
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
--- a/components/omnibox/browser/autocomplete_controller.cc
+++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -15,6 +15,7 @@
#include "base/bind.h"
#include "base/check_op.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/format_macros.h"
#include "base/metrics/histogram.h"
@@ -275,6 +276,15 @@ AutocompleteController::AutocompleteController(
search_service_worker_signal_sent_(false),
template_url_service_(provider_client_->GetTemplateURLService()) {
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering")) {
+ const std::string flag_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering");
+ provider_types &= AutocompleteProvider::TYPE_KEYWORD | AutocompleteProvider::TYPE_SEARCH |
+ AutocompleteProvider::TYPE_HISTORY_URL | AutocompleteProvider::TYPE_BOOKMARK | AutocompleteProvider::TYPE_BUILTIN;
+ if (!base::Contains(flag_value, "bookmarks"))
+ provider_types &= ~AutocompleteProvider::TYPE_BOOKMARK;
+ if (!base::Contains(flag_value, "chrome"))
+ provider_types &= ~AutocompleteProvider::TYPE_BUILTIN;
+ }
if (provider_types & AutocompleteProvider::TYPE_BOOKMARK)
providers_.push_back(new BookmarkProvider(provider_client_.get()));
if (provider_types & AutocompleteProvider::TYPE_BUILTIN)
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
--- a/components/omnibox/browser/history_url_provider.cc
+++ b/components/omnibox/browser/history_url_provider.cc
@@ -553,6 +553,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
matches_.push_back(what_you_typed_match);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
+ return;
+
// We'll need the history service to run both passes, so try to obtain it.
history::HistoryService* const history_service =
client()->GetHistoryService();
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -12,6 +12,7 @@
#include "base/base64.h"
#include "base/bind.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/i18n/break_iterator.h"
#include "base/i18n/case_conversion.h"
@@ -643,6 +644,9 @@ void SearchProvider::Run(bool query_is_private) {
}
void SearchProvider::DoHistoryQuery(bool minimal_changes) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
+ return;
+
// The history query results are synchronous, so if minimal_changes is true,
// we still have the last results and don't need to do anything.
if (minimal_changes)
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
--- a/components/url_formatter/url_fixer.cc
+++ b/components/url_formatter/url_fixer.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include "base/check_op.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/ranges/algorithm.h"
@@ -607,6 +608,8 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url);
if (chrome_url && !parts.host.is_valid())
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering") ||
+ base::Contains(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering"), "chrome"))
url.append(kChromeUIDefaultHost);
FixupPort(trimmed, parts.port, &url);
FixupPath(trimmed, parts.path, &url);
--
2.17.1
......@@ -14,7 +14,7 @@ Subject: Add flag for save-data-header
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4488,6 +4488,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -4482,6 +4482,9 @@ const FeatureEntry kFeatureEntries[] = {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
......@@ -27,7 +27,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1000,6 +1000,10 @@ const char kDisableKeepaliveFetchDescription[] =
@@ -998,6 +998,10 @@ const char kDisableKeepaliveFetchDescription[] =
"Disable fetch with keepalive set "
"(https://fetch.spec.whatwg.org/#request-keepalive-flag).";
......@@ -41,7 +41,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -568,6 +568,9 @@ extern const char kDiagnosticsAppDescription[];
@@ -565,6 +565,9 @@ extern const char kDiagnosticsAppDescription[];
extern const char kDisableKeepaliveFetchName[];
extern const char kDisableKeepaliveFetchDescription[];
......
......@@ -31,7 +31,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
// Ensure that all effective connection types returned by Network Quality
// Estimator (NQE) are also exposed via flags.
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
@@ -3742,6 +3747,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3736,6 +3741,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAndroidPictureInPictureAPIName,
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
......@@ -44,7 +44,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1484,6 +1484,10 @@ const char kMediaHistoryDescription[] =
@@ -1482,6 +1482,10 @@ const char kMediaHistoryDescription[] =
"Enables Media History which records data around media playbacks on "
"websites.";
......@@ -58,7 +58,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -872,6 +872,9 @@ extern const char kLogJsConsoleMessagesDescription[];
@@ -869,6 +869,9 @@ extern const char kLogJsConsoleMessagesDescription[];
extern const char kMediaHistoryName[];
extern const char kMediaHistoryDescription[];
......
......@@ -27,7 +27,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1063,6 +1063,11 @@ const char kEnablePciguardUiDescription[] =
@@ -1069,6 +1069,11 @@ const char kEnablePciguardUiDescription[] =
"Enable toggling Pciguard settings through the Settings App. By default, "
"this flag is enabled.";