Release 86.0.4240.194

This commit is contained in:
csagan5 2020-11-09 19:39:04 +01:00
parent f444a7dba6
commit 578556604a
10 changed files with 621 additions and 131 deletions

View file

@ -1,3 +1,9 @@
# 86.0.4240.194
* fix native pages displaying incorrectly with the sticky desktop mode (thanks to @uazo)
* re-introduce simplified NTP (fixes https://github.com/bromite/bromite/issues/701)
* re-introduce site settings to block autoplay (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/791)
* fix Omnibox flag not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/789)
# 86.0.4240.181
* allow sticky desktop mode for all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/780)

View file

@ -52,6 +52,8 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
* privacy enhancement patches from [Iridium](https://iridiumbrowser.de/), [Inox patchset](https://github.com/gcarq/inox-patchset), [Brave](https://brave.com/) and [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) projects
* security enhancement patches from [GrapheneOS](https://github.com/GrapheneOS) project
* disable scroll-to-text-fragment
* reduced referer granularity
* block gateway attacks via websockets
## Features not related to privacy
* import/export bookmarks
@ -66,6 +68,11 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
* do not ignore save prompt for users without SD cards
* disable articles and increase number of icons on new tab page
* adding an URL as bookmark will clear its blocked status for the NTP tiles
* history support in incognito mode
* view source of pages
* timezone customization
* sticky desktop mode setting
* disable video autoplay by default
You can inspect all functionality/privacy changes by reading the [patches](https://github.com/bromite/bromite/tree/master/build/patches) and/or the [CHANGELOG](./CHANGELOG.md).
@ -77,6 +84,7 @@ Flags which have been retired from upstream Chromium but are still available in
* `#pull-to-refresh`
* `#enable-search-ready-omnibox`
* `#darken-websites-checkbox-in-themes-setting`
* `#simplified-ntp`
New flags:

View file

@ -1 +1 @@
86.0.4240.181
86.0.4240.194

View file

@ -149,7 +149,7 @@ Hardening-against-incognito-mode-detection.patch
Remove-weblayer-dependency-on-Play-Services.patch
Timezone-customization.patch
Move-some-account-settings-back-to-privacy-settings.patch
Add-a-flag-to-always-view-desktop-site-for-all-websites.patch
Revert-removal-option-to-block-autoplay.patch
Automated-domain-substitution.patch
Add-flag-to-always-view-the-desktop-site-for-all-websites.patch
Revert-Remove-some-obsolete-NTP-code-post-Simplified-NTP-launch.patch
Revert-the-removal-of-an-option-to-block-autoplay.patch
Automated-domain-substitution.patch

View file

@ -494,3 +494,6 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/frameh
void clearHistory(long nativeNavigationControllerAndroid, NavigationControllerImpl caller);
int getNavigationHistory(long nativeNavigationControllerAndroid,
NavigationControllerImpl caller, Object history);
--
2.17.1

View file

@ -980,7 +980,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/Sug
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
@@ -20,7 +20,7 @@ import org.chromium.ui.mojom.WindowOpenDisposition;
@@ -24,7 +24,7 @@ import org.chromium.chrome.browser.download.DownloadOpenSource;
* Extension of {@link NativePageNavigationDelegate} with suggestions-specific methods.
*/
public class SuggestionsNavigationDelegate extends NativePageNavigationDelegateImpl {
@ -1052,7 +1052,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
#if !defined(OS_ANDROID)
{"load-media-router-component-extension",
flag_descriptions::kLoadMediaRouterComponentExtensionName,
@@ -3325,7 +3325,7 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3328,7 +3328,7 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSetMarketUrlForTestingName,
flag_descriptions::kSetMarketUrlForTestingDescription, kOsAndroid,
SINGLE_VALUE_TYPE_AND_VALUE(switches::kMarketUrlForTesting,
@ -16364,7 +16364,7 @@ diff --git a/third_party/blink/renderer/core/html/html_iframe_element.cc b/third
diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
--- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc
+++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
@@ -31,10 +31,10 @@ namespace {
@@ -32,10 +32,10 @@ namespace {
const char kWarningUnmuteFailed[] =
"Unmuting failed and the element was paused instead because the user "

View file

@ -150,3 +150,6 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f
public static final String OMNIBOX_COMPACT_SUGGESTIONS = "OmniboxCompactSuggestions";
public static final String OMNIBOX_DEFERRED_KEYBOARD_POPUP = "OmniboxDeferredKeyboardPopup";
public static final String OMNIBOX_ENABLE_CLIPBOARD_PROVIDER_IMAGE_SUGGESTIONS =
--
2.17.1

View file

@ -0,0 +1,453 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 7 Nov 2020 23:51:29 +0100
Subject: Revert "Remove some obsolete NTP code post Simplified NTP launch"
This reverts commit 4d0e4483c5f77c66a8b6193e8a3bec5d0624d6ad.
---
chrome/android/chrome_java_resources.gni | 1 +
chrome/android/chrome_java_sources.gni | 1 +
.../java/res/layout/new_tab_page_layout.xml | 7 ++
.../android/java/res/layout/ntp_shortcuts.xml | 65 +++++++++++++++++++
.../browser/bookmarks/BookmarkUtils.java | 2 +-
.../feedback/ChromeFeedbackCollector.java | 1 +
.../feedback/SimplifiedNtpFeedbackSource.java | 38 +++++++++++
.../chrome/browser/ntp/NewTabPageLayout.java | 30 ++++++++-
.../suggestions/SuggestionsConfig.java | 4 +-
.../SuggestionsNavigationDelegate.java | 14 ++++
chrome/browser/about_flags.cc | 3 +
chrome/browser/flag_descriptions.cc | 3 +
chrome/browser/flag_descriptions.h | 3 +
.../flags/android/chrome_feature_list.cc | 4 ++
.../flags/android/chrome_feature_list.h | 1 +
.../browser/flags/ChromeFeatureList.java | 1 +
components/ntp_snippets/features.cc | 6 +-
.../variations/fieldtrial_testing_config.json | 18 +++++
18 files changed, 197 insertions(+), 5 deletions(-)
create mode 100644 chrome/android/java/res/layout/ntp_shortcuts.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/feedback/SimplifiedNtpFeedbackSource.java
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -960,6 +960,7 @@ chrome_java_resources = [
"java/res/layout/new_tab_page_snippets_expandable_header.xml",
"java/res/layout/new_tab_page_snippets_expandable_header_with_menu.xml",
"java/res/layout/new_tab_page_tile_grid_placeholder.xml",
+ "java/res/layout/ntp_shortcuts.xml",
"java/res/layout/omnibox_answer_suggestion.xml",
"java/res/layout/omnibox_basic_suggestion.xml",
"java/res/layout/omnibox_entity_suggestion.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -711,6 +711,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/feedback/IMEFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/InterestFeedFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/LowEndDeviceFeedbackSource.java",
+ "java/src/org/chromium/chrome/browser/feedback/SimplifiedNtpFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/PermissionFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/ProcessIdFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/ScreenshotSource.java",
diff --git a/chrome/android/java/res/layout/new_tab_page_layout.xml b/chrome/android/java/res/layout/new_tab_page_layout.xml
--- a/chrome/android/java/res/layout/new_tab_page_layout.xml
+++ b/chrome/android/java/res/layout/new_tab_page_layout.xml
@@ -60,6 +60,13 @@
android:layout="@layout/new_tab_page_offline_card"
android:inflatedId="@+id/explore_offline_card" />
+ <ViewStub
+ android:id="@+id/shortcuts_stub"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inflatedId="@+id/shortcuts"
+ android:layout="@layout/ntp_shortcuts" />
+
<!-- Middle spacer -->
<View
android:id="@+id/ntp_middle_spacer"
diff --git a/chrome/android/java/res/layout/ntp_shortcuts.xml b/chrome/android/java/res/layout/ntp_shortcuts.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/layout/ntp_shortcuts.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2018 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/shortcuts"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:baselineAligned="false"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <FrameLayout
+ android:id="@+id/bookmarks_button"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:background="?attr/selectableItemBackground"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp" >
+
+ <org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:drawablePadding="8dp"
+ android:drawableStart="@drawable/btn_star_filled"
+ android:text="@string/menu_bookmarks"
+ android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
+ app:drawableHeight="20sp"
+ app:drawableWidth="20sp"
+ app:chromeDrawableTint="@color/default_icon_color" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:id="@+id/downloads_button"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:background="?attr/selectableItemBackground"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp" >
+
+ <org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:drawablePadding="8dp"
+ android:drawableStart="@drawable/ic_file_download_white_24dp"
+ android:text="@string/menu_downloads"
+ android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
+ app:drawableHeight="20sp"
+ app:drawableWidth="20sp"
+ app:chromeDrawableTint="@color/default_icon_color" />
+ </FrameLayout>
+</LinearLayout>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -170,7 +170,7 @@ public class BookmarkUtils {
* Shows bookmark main UI.
* @param activity An activity to start the manager with.
*/
- public static void showBookmarkManager(ChromeActivity activity) {
+ public static void showBookmarkManager(Activity activity) {
ThreadUtils.assertOnUiThread();
String url = getFirstUrlToLoad(activity);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
@@ -55,6 +55,7 @@ public class ChromeFeedbackCollector
sources.add(new LowEndDeviceFeedbackSource());
sources.add(new IMEFeedbackSource());
sources.add(new PermissionFeedbackSource());
+ sources.add(new SimplifiedNtpFeedbackSource());
sources.add(new FeedbackContextFeedbackSource(initParams.feedbackContext));
sources.add(new DuetFeedbackSource());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/SimplifiedNtpFeedbackSource.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/SimplifiedNtpFeedbackSource.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/SimplifiedNtpFeedbackSource.java
@@ -0,0 +1,38 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.feedback;
+
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
+import org.chromium.chrome.browser.ntp.NewTabPageLayout;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Provides information about whether the simplified NTP is enabled for use in feedback reports.
+ */
+public class SimplifiedNtpFeedbackSource implements FeedbackSource {
+ private static final String SIMPLIFIED_NTP_KEY = "Simplified NTP";
+ private static final String ENABLED_VALUE = "Enabled";
+ private static final String DISABLED_VALUE = "Disabled";
+
+ private final HashMap<String, String> mMap;
+
+ SimplifiedNtpFeedbackSource() {
+ mMap = new HashMap<String, String>(1);
+
+ boolean isEnabled = ChromeFeatureList.isEnabled(ChromeFeatureList.SIMPLIFIED_NTP);
+ if (!isEnabled) {
+ mMap.put(SIMPLIFIED_NTP_KEY, DISABLED_VALUE);
+ } else {
+ mMap.put(SIMPLIFIED_NTP_KEY, ENABLED_VALUE);
+ }
+ }
+
+ @Override
+ public Map<String, String> getFeedback() {
+ return mMap;
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -27,6 +27,7 @@ import org.chromium.base.MathUtils;
import org.chromium.base.TraceEvent;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider;
import org.chromium.chrome.browser.cryptids.ProbabilisticCryptidRenderer;
import org.chromium.chrome.browser.download.DownloadOpenSource;
@@ -96,6 +97,8 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
private Supplier<Tab> mTabProvider;
private CallbackController mCallbackController = new CallbackController();
+ private ViewGroup mShortcutsView;
+
/**
* Whether the tiles shown in the layout have finished loading.
* With {@link #mHasShownView}, it's one of the 2 flags used to track initialisation progress.
@@ -256,6 +259,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
}
mNoSearchLogoSpacer = findViewById(R.id.no_search_logo_spacer);
+ initializeShortcuts();
initializeSearchBoxTextView();
initializeVoiceSearchButton();
initializeLayoutChangeListener();
@@ -552,10 +556,16 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
* Updates the padding for the tile grid based on what is shown above it.
*/
private void updateTileGridPadding() {
- // Set a bit more top padding on the tile grid if there is no logo.
- int paddingTop = getResources().getDimensionPixelSize(shouldShowLogo()
+ int paddingTop;
+ if (mShortcutsView != null) {
+ // If the shortcuts view is visible, padding will be built into that view.
+ paddingTop = 0;
+ } else {
+ // Set a bit more top padding on the tile grid if there is no logo.
+ paddingTop = getResources().getDimensionPixelSize(shouldShowLogo()
? R.dimen.tile_grid_layout_padding_top
: R.dimen.tile_grid_layout_no_logo_padding_top);
+ }
mSiteSectionViewHolder.itemView.setPadding(
0, paddingTop, 0, mSiteSectionViewHolder.itemView.getPaddingBottom());
}
@@ -889,6 +899,22 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
mSearchBoxCoordinator.destroy();
}
+ private void initializeShortcuts() {
+ if (!ChromeFeatureList.isEnabled(ChromeFeatureList.SIMPLIFIED_NTP)) {
+ return;
+ }
+
+ ViewStub shortcutsStub = findViewById(R.id.shortcuts_stub);
+ mShortcutsView = (ViewGroup) shortcutsStub.inflate();
+
+ mShortcutsView.findViewById(R.id.bookmarks_button)
+ .setOnClickListener(view -> mManager.getNavigationDelegate().navigateToBookmarks());
+
+ mShortcutsView.findViewById(R.id.downloads_button)
+ .setOnClickListener(
+ view -> mManager.getNavigationDelegate().navigateToDownloadManager());
+ }
+
/**
* Makes the Search Box and Logo as wide as Most Visited.
*/
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsConfig.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsConfig.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsConfig.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsConfig.java
@@ -51,7 +51,9 @@ public final class SuggestionsConfig {
// The scroll to load feature does not work well for users who require accessibility mode.
if (ChromeAccessibilityUtil.get().isAccessibilityEnabled()) return false;
- return ChromeFeatureList.isEnabled(ChromeFeatureList.CONTENT_SUGGESTIONS_SCROLL_TO_LOAD);
+ return ChromeFeatureList.isEnabled(ChromeFeatureList.SIMPLIFIED_NTP)
+ && ChromeFeatureList.isEnabled(
+ ChromeFeatureList.CONTENT_SUGGESTIONS_SCROLL_TO_LOAD);
}
/**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
@@ -16,6 +16,10 @@ import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.PageTransition;
import org.chromium.ui.mojom.WindowOpenDisposition;
+import org.chromium.chrome.browser.bookmarks.BookmarkUtils;
+import org.chromium.chrome.browser.download.DownloadUtils;
+import org.chromium.chrome.browser.download.DownloadOpenSource;
+
/**
* Extension of {@link NativePageNavigationDelegate} with suggestions-specific methods.
*/
@@ -35,6 +39,16 @@ public class SuggestionsNavigationDelegate extends NativePageNavigationDelegateI
new LoadUrlParams(NEW_TAB_URL_HELP, PageTransition.AUTO_BOOKMARK));
}
+ public void navigateToBookmarks() {
+ //RecordUserAction.record("MobileNTPSwitchToBookmarks");
+ BookmarkUtils.showBookmarkManager(mActivity);
+ }
+
+ public void navigateToDownloadManager() {
+ //RecordUserAction.record("MobileNTPSwitchToDownloadManager");
+ DownloadUtils.showDownloadManager(mActivity, null, DownloadOpenSource.NEW_TAB_PAGE);
+ }
+
/**
* Opens the suggestions page without recording metrics.
*
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
@@ -3318,6 +3318,9 @@ const FeatureEntry kFeatureEntries[] = {
SINGLE_VALUE_TYPE_AND_VALUE(
switches::kForceShowUpdateMenuItemCustomSummary,
"Custom Summary")},
+ {"simplified-ntp", flag_descriptions::kSimplifiedNtpName,
+ flag_descriptions::kSimplifiedNtpDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(chrome::android::kSimplifiedNTP)},
{"force-show-update-menu-badge", flag_descriptions::kUpdateMenuBadgeName,
flag_descriptions::kUpdateMenuBadgeDescription, kOsAndroid,
SINGLE_VALUE_TYPE(switches::kForceShowUpdateMenuBadge)},
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
@@ -3147,6 +3147,9 @@ const char kStartSurfaceAndroidDescription[] =
"Enable showing the start surface when launching Chrome via the "
"launcher.";
+const char kSimplifiedNtpName[] = "Simplified NTP";
+const char kSimplifiedNtpDescription[] = "Show a simplified New Tab Page.";
+
const char kStrictSiteIsolationName[] = "Strict site isolation";
const char kStrictSiteIsolationDescription[] =
"Security mode that enables site isolation for all sites (SitePerProcess). "
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
@@ -1812,6 +1812,9 @@ extern const char kShoppingAssistDescription[];
extern const char kSiteIsolationForPasswordSitesName[];
extern const char kSiteIsolationForPasswordSitesDescription[];
+extern const char kSimplifiedNtpName[];
+extern const char kSimplifiedNtpDescription[];
+
extern const char kStartSurfaceAndroidName[];
extern const char kStartSurfaceAndroidDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -179,6 +179,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&kNewPhotoPicker,
&kNotificationSuspender,
&kOfflineIndicatorV2,
+ &kSimplifiedNTP,
&kOmniboxSpareRenderer,
&kOverlayNewLayout,
&kPayWithGoogleV1,
@@ -539,6 +540,9 @@ const base::Feature kNotificationSuspender{"NotificationSuspender",
const base::Feature kOfflineIndicatorV2{"OfflineIndicatorV2",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kSimplifiedNTP{"SimplifiedNTP",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
const base::Feature kOmniboxSpareRenderer{"OmniboxSpareRenderer",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -94,6 +94,7 @@ extern const base::Feature kLanguagesPreference;
extern const base::Feature kNewPhotoPicker;
extern const base::Feature kNotificationSuspender;
extern const base::Feature kOfflineIndicatorV2;
+extern const base::Feature kSimplifiedNTP;
extern const base::Feature kOmniboxSpareRenderer;
extern const base::Feature kOverlayNewLayout;
extern const base::Feature kPayWithGoogleV1;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -312,6 +312,7 @@ public abstract class ChromeFeatureList {
public static final String SEARCH_ENGINE_PROMO_EXISTING_DEVICE =
"SearchEnginePromo.ExistingDevice";
public static final String SEARCH_ENGINE_PROMO_NEW_DEVICE = "SearchEnginePromo.NewDevice";
+ public static final String SIMPLIFIED_NTP = "SimplifiedNTP";
public static final String MARK_HTTP_AS = "MarkHttpAs";
public static final String MOBILE_IDENTITY_CONSISTENCY = "MobileIdentityConsistency";
public static final String MODAL_PERMISSION_PROMPTS = "ModalPermissionPrompts";
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -13,13 +13,17 @@
#include "components/ntp_snippets/category_rankers/constant_category_ranker.h"
#include "components/variations/variations_associated_data.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/flags/android/chrome_feature_list.h"
+#endif // OS_ANDROID
+
namespace ntp_snippets {
namespace {
// All platforms proxy for whether the simplified NTP is enabled.
bool IsSimplifiedNtpEnabled() {
#if defined(OS_ANDROID)
- return true;
+ return base::FeatureList::IsEnabled(chrome::android::kSimplifiedNTP);
#else
return false;
#endif // OS_ANDROID
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -6630,6 +6630,24 @@
]
}
],
+ "SimplifiedNTP": [
+ {
+ "platforms": [
+ "android"
+ ],
+ "experiments": [
+ {
+ "name": "Enabled_NoScrollToLoad",
+ "enable_features": [
+ "SimplifiedNTP"
+ ],
+ "disable_features": [
+ "ContentSuggestionsScrollToLoad"
+ ]
+ }
+ ]
+ }
+ ],
"TabGroupsYourTabsTogether": [
{
"platforms": [
--
2.17.1

View file

@ -3,68 +3,58 @@ Date: Sat, 7 Nov 2020 21:59:18 +0000
Subject: Revert the removal of an option to block autoplay
---
.../browser_ui/site_settings/android/BUILD.gn | 10 ++++++++++
.../browser_ui/site_settings/android/BUILD.gn | 5 +++++
.../res/drawable-hdpi/settings_autoplay.png | Bin 0 -> 456 bytes
.../java/res/drawable-hdpi/settings_media.png | Bin 0 -> 196 bytes
.../res/drawable-mdpi/settings_autoplay.png | Bin 0 -> 296 bytes
.../java/res/drawable-mdpi/settings_media.png | Bin 0 -> 144 bytes
.../res/drawable-xhdpi/settings_autoplay.png | Bin 0 -> 551 bytes
.../res/drawable-xhdpi/settings_media.png | Bin 0 -> 227 bytes
.../res/drawable-xxhdpi/settings_autoplay.png | Bin 0 -> 792 bytes
.../res/drawable-xxhdpi/settings_media.png | Bin 0 -> 297 bytes
.../drawable-xxxhdpi/settings_autoplay.png | Bin 0 -> 1064 bytes
.../res/drawable-xxxhdpi/settings_media.png | Bin 0 -> 383 bytes
.../res/xml/single_website_preferences.xml | 2 ++
.../res/xml/site_settings_preferences.xml | 11 +++++++++++
.../res/xml/site_settings_preferences.xml | 4 ++++
.../ContentSettingsResources.java | 5 +++++
.../site_settings/SingleCategorySettings.java | 6 ++++++
.../site_settings/SingleWebsiteSettings.java | 2 ++
.../site_settings/SiteSettingsCategory.java | 12 +++++++++---
.../site_settings/SingleCategorySettings.java | 4 ++++
.../site_settings/SingleWebsiteSettings.java | 21 ++++++++++++++++++
.../site_settings/SiteSettingsCategory.java | 12 +++++++---
.../browser_ui/site_settings/Website.java | 8 +++++++
.../WebsitePermissionsFetcher.java | 5 +++++
.../WebsitePreferenceBridge.java | 9 +++++++++
.../android/website_preference_bridge.cc | 18 ++++++++++++++++++
.../strings/android/site_settings.grdp | 12 ++++++++++++
.../WebsitePreferenceBridge.java | 9 ++++++++
.../android/website_preference_bridge.cc | 18 +++++++++++++++
.../strings/android/site_settings.grdp | 9 ++++++++
.../core/browser/content_settings_registry.cc | 2 +-
.../core/browser/content_settings_utils.cc | 2 ++
.../core/common/content_settings.cc | 1 +
.../core/common/content_settings.h | 1 +
.../core/common/content_settings.mojom | 1 +
.../common/content_settings_mojom_traits.cc | 1 +
.../common/content_settings_mojom_traits.h | 5 +++++
.../renderer/content_settings_agent_impl.cc | 11 +++++++++++
.../renderer/content_settings_agent_impl.cc | 11 +++++++++
.../renderer/content_settings_agent_impl.h | 1 +
.../android/page_info_controller_android.cc | 1 +
components/page_info/page_info.cc | 6 +++++
components/page_info/page_info_ui.cc | 1 +
components/page_info_strings.grdp | 3 +++
.../platform/web_content_settings_client.h | 3 +++
.../core/html/media/autoplay_policy.cc | 12 +++++++++++-
.../core/html/media/autoplay_policy.cc | 12 +++++++++-
.../core/html/media/autoplay_policy.h | 4 ++++
33 files changed, 131 insertions(+), 4 deletions(-)
33 files changed, 152 insertions(+), 5 deletions(-)
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_media.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_media.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_media.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_media.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_media.png
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
--- a/components/browser_ui/site_settings/android/BUILD.gn
+++ b/components/browser_ui/site_settings/android/BUILD.gn
@@ -189,6 +189,16 @@ android_resources("java_resources") {
@@ -189,6 +189,11 @@ android_resources("java_resources") {
"java/res/drawable-xxxhdpi/settings_storage.png",
"java/res/drawable-xxxhdpi/settings_usb.png",
"java/res/drawable-xxxhdpi/web_asset.png",
+ "java/res/drawable-hdpi/settings_autoplay.png",
+ "java/res/drawable-hdpi/settings_media.png",
+ "java/res/drawable-xhdpi/settings_autoplay.png",
+ "java/res/drawable-xhdpi/settings_media.png",
+ "java/res/drawable-xxhdpi/settings_autoplay.png",
+ "java/res/drawable-xxhdpi/settings_media.png",
+ "java/res/drawable-mdpi/settings_autoplay.png",
+ "java/res/drawable-mdpi/settings_media.png",
+ "java/res/drawable-xxxhdpi/settings_autoplay.png",
+ "java/res/drawable-xxxhdpi/settings_media.png",
"java/res/drawable/ic_person_24dp.xml",
"java/res/drawable/settings_bluetooth.xml",
"java/res/layout/add_site_dialog.xml",
@ -86,19 +76,6 @@ y{$1Kp0i#npN<C~x1#L&}8>IV|-Tf!x{>CqV{oZM{Igf1s0000<MNUMnLSTY>m&@A#
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_media.png b/components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_media.png
new file mode 100644
index 0000000000000000000000000000000000000000..aafa655ac842373e74c4b9b9766fe84e9a9868a8
GIT binary patch
literal 196
zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8x2KC^NX4zU=MHi<81S$L=<k{~
zS9xXl^B1m0)6OYf(Y&HDWs&Na3vw+<lY{F{DEqE0%Fda1fa&lf;fQygTZ<-#9VmKj
z)sXP%<AweHg>`<1b9tg-XZ)JnQYL=tvV}~mQQaf~xdSupJvH|JXFV9XkV$dfg>-?u
vn-h2yPqj{9I#J^BGX7y(%C2Q$8%r6}!(y+fKlT0sbQXiBtDnm{r-UW|{=iO$
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png
new file mode 100644
index 0000000000000000000000000000000000000000..49fa10d44f4007532d0d03d15fdcb1a715857e96
@ -114,18 +91,6 @@ u*BbnAfuj*Re80yVxjo)NA1L&T?!2C$I@?4>V>|Ky0000<MNUMnLSTX*1bI&Y
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_media.png b/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_media.png
new file mode 100644
index 0000000000000000000000000000000000000000..5e2d76f1e2a82a7b63617c6d7631ef4179a3c228
GIT binary patch
literal 144
zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+ia8DP<kP60R2|a~l%C7>i{Fh)C
zuztl*CdP5d)Wx2maPjwMQ|pA}h1oy29|>(?Ua0s=-o^O}<BZA~Iy}5B4?bM}P|uRp
rQRg$I&7FgHo=Zlh$Xm;pO~wp5?G52)gySawtzhtU^>bP0l+XkKX{9bg
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png
new file mode 100644
index 0000000000000000000000000000000000000000..5a4128a5e02949de754f9cab2635824eda8c539c
@ -146,20 +111,6 @@ p?=l}ClAlmgAAvHTvG;Wo>j%AMEx!+_@2>y=002ovPDHLkV1fY;_gnw~
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_media.png b/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_media.png
new file mode 100644
index 0000000000000000000000000000000000000000..db4cf4f04ea4738e5c66fe90026ff1272cdd8783
GIT binary patch
literal 227
zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0DRh}-6Ar*0NFWB-OGT>o-5W`$0
zVR5|p<$<#jMSNAFZDkA19~}4TP*}X{(9BieH|_QK_h^X`&taMElMEdew%=Xu${%}c
z>hYd@^Bw#2pT>Ooy>u?~gOIrG)xXX5&t`oR6t{SL{^#A14CWa%?Cc%yA267fZ#W<u
zl?>#}|If(uDZ<u)!JjFyp<$hzf<kg=!Ul(RoE~Nl*H47x{<&hR`B$mv&*GFRe{AO^
b&Jbrm_kCI#v(9s%s~J39{an^LB{Ts5x>sAN
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png
new file mode 100644
index 0000000000000000000000000000000000000000..7fceb8c2b546970a3720e8ab225799aa03895b7f
@ -185,21 +136,6 @@ WnED%yq_MdG0000<MNUMnLSTZmtagO}
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_media.png b/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_media.png
new file mode 100644
index 0000000000000000000000000000000000000000..4aa40b20ba9ff27f5d7858c0f9b99d90583c6e7a
GIT binary patch
literal 297
zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhawK6tt~hE&A8z2wVv$Uva&;S-@t
zw{H}u1ZmDN=DO5+cWZg!^>u%GJESvvoH^$@{kW&2-mUH&Qm5D=;FRVs%X@6U|5n~*
zZ__6k@b-0u=f3z+JJm01l5X&_&5k8A;<ly!I5*{`&V;*vcid}x?=$C^<DB>h@`ejG
zf1G6f$Z`6EO$Y3g91a1QAlwARC8lu|?lvAE{9#EmgOPcI7#kzY1zTeQ2ZoEvAabU<
z19vk6(~0M7OdJaedHHw)1-`Cs*rjn|m#M=wSI4;7ZZcOY);_x0YOr!8_gDM%YZu2o
lsP4ZK`F!gs9iW?Eus#pSh>kCpxdHS$gQu&X%Q~loCIHn%d<p;n
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png
new file mode 100644
index 0000000000000000000000000000000000000000..92a315bb00ac1f4dc675e894bf4af3ba7c68bf39
@ -230,23 +166,6 @@ ib6hJ{tXQ#P#rX?0El=KlH_u1_0000<MNUMnLSTX(y!wd%
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_media.png b/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_media.png
new file mode 100644
index 0000000000000000000000000000000000000000..d794102450b9781bb26696f3cfa08add7994e4e6
GIT binary patch
literal 383
zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7!06`b;uuoF`1ZP?-(d#<w?y$L
zY9>#Fp2!%_zV>{<!i5H(QZ<5>F8`{yVlop4Td;!pv81p=lm1V=ce_mIXYwA8l^tNP
z>}`Hf^4$43KP-RW{%L95Cw%(s-_lic-mUv{@z=@4$A8}35?!Uoc4Ym3lkXX~SnD?*
zefE#@LwjLF0lT3>?C;cH6E4_xFqYZ(WxZ2iv*}+v>$?Kmo*N2#nk62rH`92pAiv=s
z-!%3$`<rVT-tc{5oMqj?_${sZ6W=C=Mb;<SJKibCFR1y#$Z)Tl4d}50`mW3%U&;fC
zh_4JUAcFP~Y9CN=!z)IEDZC(+kw3rw6=Ak|$y=hRV0x<IN(;k%uK!x^YNL-<uIBo%
z?bOP9HyniuR+xvzeLWVvk$>g)vR}U*#(MOYGW`!Ze{Jcr@7w)dK;R4SjE>VwZd4b5
P>}T+F^>bP0l+XkKNl&N6
literal 0
HcmV?d00001
diff --git a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml
--- a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml
+++ b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml
@ -262,7 +181,7 @@ diff --git a/components/browser_ui/site_settings/android/java/res/xml/single_web
diff --git a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml
--- a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml
+++ b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml
@@ -65,6 +65,17 @@
@@ -65,6 +65,10 @@
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="protected_content" />
@ -270,13 +189,6 @@ diff --git a/components/browser_ui/site_settings/android/java/res/xml/site_setti
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
+ android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
+ android:key="autoplay" />
+ <!-- Media -->
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
+ android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
+ android:key="media"
+ android:title="@string/media_permission_title"
+ android:icon="@drawable/settings_media"
+ app:iconTint="@color/default_icon_color" />
<!-- Sound -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
@ -307,13 +219,11 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
} else if (mCategory.showSites(SiteSettingsCategory.Type.BACKGROUND_SYNC)) {
resource = R.string.website_settings_add_site_description_background_sync;
} else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
@@ -754,6 +756,10 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
@@ -754,6 +756,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
boolean exception = false;
if (mCategory.showSites(SiteSettingsCategory.Type.SOUND)) {
exception = true;
+ } else if (mCategory.showSites(SiteSettingsCategory.Type.AUTOPLAY)
+ && !WebsitePreferenceBridge.isCategoryEnabled(
+ browserContextHandle, ContentSettingsType.AUTOPLAY)) {
+ } else if (mCategory.showSites(SiteSettingsCategory.Type.AUTOPLAY)) {
+ exception = true;
} else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) {
exception = true;
@ -330,6 +240,39 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
default:
return null;
}
@@ -422,6 +424,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
setUpJavascriptPreference(preference);
} else if (type == ContentSettingsType.COOKIES) {
setUpCookiePreference(preference);
+ } else if (type == ContentSettingsType.AUTOPLAY) {
+ setUpAutoplayPreference(preference);
} else {
// ContentSettingException can not be embargoed.
setUpListPreference(preference, mSite.getContentSettingPermission(type),
@@ -890,6 +894,23 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
}
}
+ private void setUpAutoplayPreference(Preference preference) {
+ @ContentSettingValues
+ @Nullable
+ Integer currentValue = mSite.getContentSettingPermission(ContentSettingsType.AUTOPLAY);
+ // In order to always show the autoplay permission, set it up with the default value if it
+ // doesn't have a current value.
+ if (currentValue == null) {
+ currentValue = WebsitePreferenceBridge.isCategoryEnabled(
+ getSiteSettingsClient().getBrowserContextHandle(),
+ ContentSettingsType.AUTOPLAY)
+ ? ContentSettingValues.ALLOW
+ : ContentSettingValues.BLOCK;
+ }
+ // Not possible to embargo AUTOPLAY.
+ setUpListPreference(preference, currentValue, false /* isEmbargoed */);
+ }
+
private void setUpSoundPreference(Preference preference) {
@ContentSettingValues
@Nullable
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
@ -376,6 +319,24 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
default:
assert false;
return "";
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
@@ -226,6 +226,14 @@ public final class Website implements Serializable {
} else {
RecordUserAction.record("JavascriptContentSetting.DisableBy.SiteSettings");
}
+ } else if (type == ContentSettingsType.AUTOPLAY) {
+ // It is possible to set the permission without having an existing exception,
+ // because we always show the autoplay permission in Site Settings.
+ if (exception == null) {
+ exception = new ContentSettingException(
+ ContentSettingsType.AUTOPLAY, getAddress().getHost(), value, "");
+ setContentSettingException(type, exception);
+ }
} else if (type == ContentSettingsType.SOUND) {
// It is possible to set the permission without having an existing exception,
// because we always show the sound permission in Site Settings.
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java
@ -441,7 +402,7 @@ diff --git a/components/browser_ui/site_settings/android/website_preference_brid
+static jboolean JNI_WebsitePreferenceBridge_GetAutoplayEnabled(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& jbrowser_context_handle) {
+ return GetBooleanForContentSetting(jbrowser_context_handle,
+ return GetBooleanForContentSetting(jbrowser_context_handle,
+ ContentSettingsType::AUTOPLAY);
+}
+
@ -458,16 +419,13 @@ diff --git a/components/browser_ui/site_settings/android/website_preference_brid
diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp
--- a/components/browser_ui/strings/android/site_settings.grdp
+++ b/components/browser_ui/strings/android/site_settings.grdp
@@ -12,6 +12,18 @@
@@ -12,6 +12,15 @@
<message name="IDS_ADS_PERMISSION_TITLE" desc="Title for the ads permission [CHAR-LIMIT=32]">
Ads
</message>
+ <message name="IDS_AUTOPLAY_TITLE" desc='Title for the Autoplay settings screen [CHAR-LIMIT=32]'>
+ Autoplay
+ </message>
+ <message name="IDS_MEDIA_PERMISSION_TITLE" desc="Title of the menu containing the media permissions [CHAR-LIMIT=32]">
+ Media
+ </message>
+ <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_AUTOPLAY" desc="The description for the allow autoplay of muted videos for website dialog.">
+ Allow autoplay of muted videos for a specific site.
+ </message>
@ -477,6 +435,18 @@ diff --git a/components/browser_ui/strings/android/site_settings.grdp b/componen
<message name="IDS_AR_PERMISSION_TITLE" desc="Title of the permission to use Augmented Reality [CHAR-LIMIT=32]">
Augmented reality
</message>
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -324,7 +324,7 @@ void ContentSettingsRegistry::Init() {
ContentSettingsInfo::PERSISTENT,
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
- Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW,
+ Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_BLOCK,
WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(),
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK),
WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE,
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc
--- a/components/content_settings/core/browser/content_settings_utils.cc
+++ b/components/content_settings/core/browser/content_settings_utils.cc
@ -544,7 +514,7 @@ diff --git a/components/content_settings/core/common/content_settings_mojom_trai
+ const RendererContentSettingRules& r) {
+ return r.autoplay_rules;
+ }
+
+
static const std::vector<ContentSettingPatternSource>& popup_redirect_rules(
const RendererContentSettingRules& r) {
return r.popup_redirect_rules;
@ -591,6 +561,53 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp
permissions_to_display.push_back(ContentSettingsType::SOUND);
if (base::FeatureList::IsEnabled(features::kWebNfc))
permissions_to_display.push_back(ContentSettingsType::NFC);
diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc
--- a/components/page_info/page_info.cc
+++ b/components/page_info/page_info.cc
@@ -102,6 +102,7 @@ ContentSettingsType kPermissionType[] = {
ContentSettingsType::ADS,
ContentSettingsType::BACKGROUND_SYNC,
ContentSettingsType::SOUND,
+ ContentSettingsType::AUTOPLAY,
ContentSettingsType::AUTOMATIC_DOWNLOADS,
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER,
@@ -168,6 +169,11 @@ bool ShouldShowPermission(const PageInfoUI::PermissionInfo& info,
return is_subresource_filter_activated;
}
+ // Always show autoplay when it has a site-specific override
+ if (info.type == ContentSettingsType::AUTOPLAY) {
+ return true;
+ }
+
if (info.type == ContentSettingsType::SOUND) {
// The sound content setting should always show up when the tab has played
// audio.
diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_info_ui.cc
--- a/components/page_info/page_info_ui.cc
+++ b/components/page_info/page_info_ui.cc
@@ -162,6 +162,7 @@ base::span<const PermissionsUIInfo> GetContentSettingsUIInfo() {
IDS_PAGE_INFO_TYPE_PROTECTED_MEDIA_IDENTIFIER},
#endif
{ContentSettingsType::ADS, IDS_PAGE_INFO_TYPE_ADS},
+ {ContentSettingsType::AUTOPLAY, IDS_PAGE_INFO_TYPE_AUTOPLAY},
{ContentSettingsType::SOUND, IDS_PAGE_INFO_TYPE_SOUND},
{ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_PAGE_INFO_TYPE_CLIPBOARD},
{ContentSettingsType::SENSORS,
diff --git a/components/page_info_strings.grdp b/components/page_info_strings.grdp
--- a/components/page_info_strings.grdp
+++ b/components/page_info_strings.grdp
@@ -275,6 +275,9 @@
<message name="IDS_PAGE_INFO_TYPE_SOUND" desc="The label used for the sound permission controls in the Page Info popup.">
Sound
</message>
+ <message name="IDS_PAGE_INFO_TYPE_AUTOPLAY" desc="The label used for the autoplay permission controls in the Page Info popup.">
+ Autoplay
+ </message>
<message name="IDS_PAGE_INFO_TYPE_CLIPBOARD" desc="The label used for the clipboard permission controls in the Page Info popup.">
Clipboard
</message>
diff --git a/third_party/blink/public/platform/web_content_settings_client.h b/third_party/blink/public/platform/web_content_settings_client.h
--- a/third_party/blink/public/platform/web_content_settings_client.h
+++ b/third_party/blink/public/platform/web_content_settings_client.h
@ -633,7 +650,7 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/thi
+ if (!frame)
+ return false;
+ if (auto* settings_client = frame->GetContentSettingsClient())
+ return settings_client->AllowAutoplay(true /* default_value */);
+ return settings_client->AllowAutoplay(false /* default_value */);
+ return true;
+}
+

View file

@ -287,7 +287,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
}
+ public static int getCategorySummary(int contentType, @ContentSettingValues int value) {
+ if(contentType == ContentSettingsType.TIMEZONE_OVERRIDE) {
+ if (contentType == ContentSettingsType.TIMEZONE_OVERRIDE) {
+ switch (value) {
+ case ContentSettingValues.ALLOW:
+ return R.string.website_settings_category_timezone_override_allowed;
@ -301,7 +301,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
+ }
+ else
+ return getCategorySummary(value);
+ }
+ }
+
/**
* Returns the string resource id for a content type to show with a permission category.
@ -310,7 +310,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
return descriptionIDs;
}
}
+ else if(contentType == ContentSettingsType.TIMEZONE_OVERRIDE) {
+ else if (contentType == ContentSettingsType.TIMEZONE_OVERRIDE) {
+ int[] descriptionIDs = {
+ R.string.website_settings_category_timezone_override_allowed, // ALLOWED
+ R.string.website_settings_category_timezone_override_custom, // ASK
@ -411,9 +411,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES) && mRequiresFourStateSetting) {
setting = cookieSettingsExceptionShouldBlock() ? ContentSettingValues.BLOCK
: ContentSettingValues.ALLOW;
+ } else if(mRequiresTriStateSetting) {
+ } else if (mRequiresTriStateSetting) {
+ setting = WebsitePreferenceBridge.getContentSetting(browserContextHandle, mCategory.getContentSettingsType());
+ if(setting == ContentSettingValues.ALLOW) {
+ if (setting == ContentSettingValues.ALLOW) {
+ setting = ContentSettingValues.BLOCK;
+ } else {
+ setting = ContentSettingValues.ALLOW;
@ -776,9 +776,9 @@ new file mode 100755
+ public void run()
+ {
+ for (int j = 0; j < timezones.size(); j++) {
+ if(currentSelected.equals(timezones.get(j))) {
+ if (currentSelected.equals(timezones.get(j))) {
+ listView.requestFocusFromTouch();
+ listView.setSelection(j);
+ listView.setSelection(j);
+ adapter.notifyDataSetChanged();
+ break;
+ }