fix patch for v98

This commit is contained in:
Carmelo Messina 2022-02-03 19:20:53 +01:00
parent 954646fd7f
commit b6e7de5b28
No known key found for this signature in database
GPG key ID: 968894BE688289FD
23 changed files with 274 additions and 287 deletions

View file

@ -6,9 +6,9 @@ Add a Google search engine that forces languages to English,
disable from all its searches RLZ and field experiments querystring parameters.
---
.../search_engines/prepopulated_engines.json | 21 ++
.../search_engines/search_engine_type.h | 2 +-
.../search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 216 +++++++++---------
3 files changed, 130 insertions(+), 109 deletions(-)
3 files changed, 130 insertions(+), 108 deletions(-)
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
--- a/components/search_engines/prepopulated_engines.json
@ -44,11 +44,10 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
--- a/components/search_engines/search_engine_type.h
+++ b/components/search_engines/search_engine_type.h
@@ -74,7 +74,7 @@ enum SearchEngineType {
SEARCH_ENGINE_OCEANHERO = 57,
@@ -75,6 +75,7 @@ enum SearchEngineType {
SEARCH_ENGINE_PRIVACYWALL = 58,
SEARCH_ENGINE_ECOSIA = 59,
- SEARCH_ENGINE_PETALSEARCH = 60,
SEARCH_ENGINE_PETALSEARCH = 60,
+ SEARCH_ENGINE_GOOGLE_EN,
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.

View file

@ -14,18 +14,18 @@ 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
@@ -7741,6 +7741,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
chrome::android::kBookmarksExportUseSaf)},
@@ -7738,6 +7738,11 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSearchReadyOmniboxDescription, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kSearchReadyOmniboxFeature)},
+ {"cleartext-permitted",
+ flag_descriptions::kIsCleartextPermittedName,
+ flag_descriptions::kIsCleartextPermittedDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)},
+
// NOTE: Adding a new flag requires adding a corresponding entry to enum
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the
#if defined(OS_ANDROID)
{"use-ulp-languages-in-chrome",
flag_descriptions::kUseULPLanguagesInChromeName,
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

View file

@ -23,8 +23,8 @@ for SimpleURLLoaders as well.
chrome/browser/resources/proxy_config.js | 266 +++++++++++
chrome/browser/ui/BUILD.gn | 2 +
.../webui/chrome_web_ui_controller_factory.cc | 3 +
chrome/browser/ui/webui/proxy_config_ui.cc | 419 ++++++++++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 33 ++
chrome/browser/ui/webui/proxy_config_ui.cc | 416 ++++++++++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 29 ++
chrome/common/webui_url_constants.cc | 4 +
chrome/common/webui_url_constants.h | 2 +
.../pref_proxy_config_tracker_impl.cc | 1 +
@ -33,7 +33,7 @@ for SimpleURLLoaders as well.
.../proxy_config/proxy_policy_handler.cc | 2 +-
net/proxy_resolution/proxy_config.cc | 52 ++-
net/proxy_resolution/proxy_config.h | 3 +
24 files changed, 998 insertions(+), 14 deletions(-)
24 files changed, 991 insertions(+), 14 deletions(-)
create mode 100644 chrome/browser/resources/proxy_config.css
create mode 100644 chrome/browser/resources/proxy_config.html
create mode 100644 chrome/browser/resources/proxy_config.js
@ -660,7 +660,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webu
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/webui/proxy_config_ui.cc
@@ -0,0 +1,419 @@
@@ -0,0 +1,416 @@
+/*
+ This file is part of Bromite.
+
@ -689,7 +689,6 @@ new file mode 100644
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
@ -771,8 +770,6 @@ new file mode 100644
+ void apply(const net::ProxyConfig& config);
+
+ base::WeakPtrFactory<ProxyConfigMessageHandler> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyConfigMessageHandler);
+};
+
+ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile)
@ -1084,7 +1081,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.h b/chrome/browser/ui/webui
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/webui/proxy_config_ui.h
@@ -0,0 +1,33 @@
@@ -0,0 +1,29 @@
+/*
+ This file is part of Bromite.
+
@ -1105,16 +1102,12 @@ new file mode 100644
+#ifndef CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
+#define CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_controller.h"
+
+// The WebUI for chrome://proxy/.
+class ProxyConfigUI : public content::WebUIController {
+ public:
+ explicit ProxyConfigUI(content::WebUI* web_ui);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ProxyConfigUI);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_

View file

@ -823,8 +823,8 @@ 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
@@ -7694,6 +7694,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(language::kUseULPLanguagesInChrome)}
@@ -7687,6 +7687,12 @@ const FeatureEntry kFeatureEntries[] = {
SINGLE_VALUE_TYPE(switches::kPervasiveSystemAccentColor)},
#endif
+ {"export-bookmarks-use-saf",
@ -833,9 +833,9 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
+ FEATURE_VALUE_TYPE(
+ chrome::android::kBookmarksExportUseSaf)},
+
// NOTE: Adding a new flag requires adding a corresponding entry to enum
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the
#if defined(OS_ANDROID)
{"use-ulp-languages-in-chrome",
flag_descriptions::kUseULPLanguagesInChromeName,
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc

View file

@ -158,7 +158,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
}
return true;
}
@@ -268,6 +282,16 @@ public class PrivacySettings
@@ -267,6 +281,16 @@ public class PrivacySettings
canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
}

View file

@ -78,9 +78,9 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
--- a/components/search_engines/search_engine_type.h
+++ b/components/search_engines/search_engine_type.h
@@ -76,6 +76,7 @@ enum SearchEngineType {
SEARCH_ENGINE_PRIVACYWALL = 58,
@@ -77,6 +77,7 @@ enum SearchEngineType {
SEARCH_ENGINE_ECOSIA = 59,
SEARCH_ENGINE_PETALSEARCH = 60,
SEARCH_ENGINE_GOOGLE_EN,
+ SEARCH_ENGINE_GOOGLE_SIMPLE,

View file

@ -3,7 +3,6 @@ Date: Fri, 22 May 2020 22:43:27 -0400
Subject: Allow building without enable_reporting
---
content/browser/BUILD.gn | 4 ----
.../devtools/protocol/network_handler.cc | 2 ++
.../cross_origin_embedder_policy_reporter.cc | 3 ++-
.../net/cross_origin_opener_policy_reporter.cc | 16 +++++++---------
@ -19,22 +18,8 @@ Subject: Allow building without enable_reporting
.../blink/renderer/core/frame/local_frame.h | 6 +++---
.../renderer/core/frame/reporting_context.cc | 9 +++++++++
.../renderer/core/frame/reporting_context.h | 7 +++++--
16 files changed, 48 insertions(+), 47 deletions(-)
15 files changed, 48 insertions(+), 43 deletions(-)
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -1284,10 +1284,6 @@ source_set("browser") {
"permissions/permission_service_impl.h",
# TODO(698985): Remove `permission_util.*`.
- "net/cross_origin_embedder_policy_reporter.cc",
- "net/cross_origin_embedder_policy_reporter.h",
- "net/cross_origin_opener_policy_reporter.cc",
- "net/cross_origin_opener_policy_reporter.h",
"permissions/permission_util.cc",
"permissions/permission_util.h",
"picture_in_picture/picture_in_picture_service_impl.cc",
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
--- a/content/browser/devtools/protocol/network_handler.cc
+++ b/content/browser/devtools/protocol/network_handler.cc

View file

@ -151,7 +151,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
updatePreferences();
}
@@ -345,4 +382,21 @@ public class PrivacySettings
@@ -344,4 +381,21 @@ public class PrivacySettings
public void setSnackbarManager(SnackbarManager manager) {
mSnackbarManager = manager;
}

View file

@ -7,19 +7,19 @@ This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs
---
.../chrome_autocomplete_scheme_classifier.cc | 1 +
chrome/browser/history/history_utils.cc | 1 +
chrome/browser/ui/singleton_tabs.cc | 3 +-
.../omnibox/browser/autocomplete_input.cc | 8 ++++-
chrome/browser/ui/singleton_tabs.cc | 3 ++-
.../omnibox/browser/autocomplete_input.cc | 8 +++++-
components/url_formatter/url_fixer.cc | 4 +++
.../child_process_security_policy_impl.cc | 1 +
net/BUILD.gn | 2 ++
net/url_request/trk_protocol_handler.cc | 25 +++++++++++++++
net/url_request/trk_protocol_handler.h | 31 +++++++++++++++++++
net/url_request/url_request.cc | 8 +++++
.../url_request_context_builder.cc | 3 ++
net/url_request/trk_protocol_handler.cc | 25 +++++++++++++++++
net/url_request/trk_protocol_handler.h | 27 +++++++++++++++++++
net/url_request/url_request.cc | 8 ++++++
.../url_request_context_builder.cc | 3 +++
url/url_constants.cc | 1 +
url/url_constants.h | 1 +
url/url_util.cc | 2 ++
14 files changed, 89 insertions(+), 2 deletions(-)
14 files changed, 85 insertions(+), 2 deletions(-)
create mode 100644 net/url_request/trk_protocol_handler.cc
create mode 100644 net/url_request/trk_protocol_handler.h
@ -158,7 +158,7 @@ diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protoc
new file mode 100644
--- /dev/null
+++ b/net/url_request/trk_protocol_handler.h
@@ -0,0 +1,31 @@
@@ -0,0 +1,27 @@
+// Copyright (c) 2018 The ungoogled-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.
@ -167,7 +167,6 @@ new file mode 100644
+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "net/base/net_export.h"
+#include "net/url_request/url_request_job_factory.h"
+
@ -182,9 +181,6 @@ new file mode 100644
+ TrkProtocolHandler();
+ std::unique_ptr<URLRequestJob> CreateJob(URLRequest* request) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
+};
+
+} // namespace net

View file

@ -34,10 +34,10 @@ Fix RestoreForeignSessionTab by recreating the tab (issue #681)
chrome/common/pref_names.cc | 3 +
chrome/common/pref_names.h | 1 +
components/component_updater/BUILD.gn | 7 +
.../adblock_updater_service.cc | 272 ++++++++++++++++++
.../adblock_updater_service.cc | 271 ++++++++++++++++++
.../adblock_updater_service.h | 99 +++++++
.../download_filters_task.cc | 224 +++++++++++++++
.../component_updater/download_filters_task.h | 129 +++++++++
.../component_updater/download_filters_task.h | 127 ++++++++
...ent_subresource_filter_throttle_manager.cc | 11 +
.../content/browser/ruleset_service.cc | 33 ++-
.../content/browser/ruleset_service.h | 7 +-
@ -46,7 +46,7 @@ Fix RestoreForeignSessionTab by recreating the tab (issue #681)
.../browser/subresource_filter_features.cc | 113 +-------
.../core/common/indexed_ruleset.cc | 5 +-
.../navigation_throttle_runner.cc | 5 -
37 files changed, 1158 insertions(+), 139 deletions(-)
37 files changed, 1155 insertions(+), 139 deletions(-)
create mode 100644 chrome/android/java/res/layout/adblock_editor.xml
create mode 100644 chrome/android/java/res/xml/adblock_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java
@ -754,7 +754,7 @@ diff --git a/components/component_updater/adblock_updater_service.cc b/component
new file mode 100644
--- /dev/null
+++ b/components/component_updater/adblock_updater_service.cc
@@ -0,0 +1,272 @@
@@ -0,0 +1,271 @@
+/*
+ This file is part of Bromite.
+
@ -785,7 +785,6 @@ new file mode 100644
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/logging.h"
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
@ -1364,7 +1363,7 @@ diff --git a/components/component_updater/download_filters_task.h b/components/c
new file mode 100644
--- /dev/null
+++ b/components/component_updater/download_filters_task.h
@@ -0,0 +1,129 @@
@@ -0,0 +1,127 @@
+/*
+ This file is part of Bromite.
+
@ -1389,7 +1388,6 @@ new file mode 100644
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/threading/thread_checker.h"
+#include "components/update_client/network.h"
@ -1488,7 +1486,6 @@ new file mode 100644
+ base::FilePath file_path_;
+
+ friend class base::RefCounted<DownloadFiltersTask>;
+ DISALLOW_COPY_AND_ASSIGN(DownloadFiltersTask);
+};
+
+} // namespace update_client

View file

@ -203,8 +203,8 @@ diff --git a/content/browser/attribution_reporting/attribution_network_sender_im
scoped_refptr<net::HttpResponseHeaders> headers) {
+ if ((true)) {
+ std::move(sent_callback)
+ .Run(SentReportInfo(std::move(report),
+ SentReportInfo::Status::kSent,
+ .Run(SentReport(std::move(report),
+ SentReport::Status::kSent,
+ /*response_code*/200));
+ return;
+ }

View file

@ -5,7 +5,8 @@ Subject: Disable metrics collection for NTP tiles
---
.../browser/android/ntp/most_visited_sites_bridge.cc | 10 ++--------
components/ntp_tiles/BUILD.gn | 3 ---
2 files changed, 2 insertions(+), 11 deletions(-)
components/ntp_tiles/most_visited_sites.cc | 2 --
3 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
@ -82,6 +83,18 @@ diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
"most_visited_sites_unittest.cc",
"popular_sites_impl_unittest.cc",
]
diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -724,8 +724,6 @@ void MostVisitedSites::SaveTilesAndNotify(
: new_tiles;
if (fixed_tiles.size() != new_tiles.size()) {
- metrics::RecordsMigratedDefaultAppDeleted(
- DeletedTileType::kMostVisitedSite);
}
if (!current_tiles_.has_value() || (*current_tiles_ != fixed_tiles)) {
current_tiles_.emplace(std::move(fixed_tiles));
--
2.20.1

View file

@ -53,7 +53,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
Preference privacyReviewPreference = findPreference(PREF_PRIVACY_REVIEW);
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_REVIEW)) {
getPreferenceScreen().removePreference(privacyReviewPreference);
@@ -304,12 +291,6 @@ public class PrivacySettings
@@ -303,12 +290,6 @@ public class PrivacySettings
secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
}

View file

@ -12,7 +12,7 @@ Disable CrowdDeny feature
.../EnhancedProtectionPromoController.java | 8 --
.../EnhancedProtectionPromoUtils.java | 3 +-
.../privacy/settings/PrivacySettings.java | 40 ----------
.../SafeBrowsingSettingsLauncher.java | 8 --
.../SafeBrowsingSettingsLauncher.java | 7 --
.../usage_stats/UsageStatsConsentDialog.java | 5 --
.../android/chrome_main_delegate_android.cc | 1 +
chrome/browser/BUILD.gn | 30 --------
@ -26,7 +26,7 @@ Disable CrowdDeny feature
.../browser/chrome_content_browser_client.h | 2 +
...ontent_browser_client_receiver_bindings.cc | 2 +
.../file_type_policies_component_installer.cc | 16 +---
.../browser/component_updater/registration.cc | 7 --
.../browser/component_updater/registration.cc | 8 --
.../chrome_download_manager_delegate.cc | 41 +++++-----
.../chrome_download_manager_delegate.h | 8 +-
.../browser/download/download_item_model.cc | 15 +++-
@ -51,7 +51,7 @@ Disable CrowdDeny feature
...ve_origin_permission_revocation_request.cc | 2 +
.../permissions/chrome_permissions_client.cc | 14 ----
.../permissions/chrome_permissions_client.h | 3 -
...hrome_browser_main_extra_parts_profiles.cc | 2 -
...hrome_browser_main_extra_parts_profiles.cc | 3 -
chrome/browser/profiles/profile_impl.cc | 4 +-
chrome/browser/safe_browsing/BUILD.gn | 4 +-
chrome/browser/safe_browsing/android/BUILD.gn | 4 -
@ -88,7 +88,7 @@ Disable CrowdDeny feature
.../file_system_access_permission_context.h | 6 --
weblayer/BUILD.gn | 1 -
weblayer/test/BUILD.gn | 1 -
82 files changed, 181 insertions(+), 684 deletions(-)
82 files changed, 181 insertions(+), 685 deletions(-)
diff --git a/chrome/android/java/res/xml/google_services_preferences.xml b/chrome/android/java/res/xml/google_services_preferences.xml
--- a/chrome/android/java/res/xml/google_services_preferences.xml
@ -264,16 +264,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingSettingsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingSettingsLauncher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingSettingsLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingSettingsLauncher.java
@@ -6,8 +6,6 @@ package org.chromium.chrome.browser.safe_browsing;
import android.content.Context;
@@ -7,7 +7,6 @@ import android.content.Context;
import org.chromium.base.annotations.CalledByNative;
-import org.chromium.chrome.browser.safe_browsing.metrics.SettingsAccessPoint;
import org.chromium.chrome.browser.safe_browsing.metrics.SettingsAccessPoint;
-import org.chromium.chrome.browser.safe_browsing.settings.SafeBrowsingSettingsFragment;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
import org.chromium.content_public.browser.WebContents;
@@ -22,11 +20,5 @@ public class SafeBrowsingSettingsLauncher {
@@ -22,11 +21,5 @@ public class SafeBrowsingSettingsLauncher {
@CalledByNative
private static void showSafeBrowsingSettings(
WebContents webContents, @SettingsAccessPoint int accessPoint) {
@ -813,7 +812,15 @@ diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/c
#include "components/nacl/common/buildflags.h"
#include "device/vr/buildflags/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
@@ -188,9 +186,6 @@ void RegisterComponentsForUpdate() {
@@ -166,7 +164,6 @@ void RegisterComponentsForUpdate() {
component_updater::RegisterCRLSetComponent(cus);
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
- RegisterOriginTrialsComponent(cus);
RegisterMediaEngagementPreloadComponent(cus, base::OnceClosure());
#if defined(OS_WIN)
@@ -188,9 +185,6 @@ void RegisterComponentsForUpdate() {
MaybeRegisterPKIMetadataComponent(cus);
@ -823,7 +830,7 @@ diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/c
#if BUILDFLAG(IS_CHROMEOS_ASH)
RegisterSmartDimComponent(cus);
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -207,8 +202,6 @@ void RegisterComponentsForUpdate() {
@@ -207,8 +201,6 @@ void RegisterComponentsForUpdate() {
RegisterAutofillStatesComponent(cus, g_browser_process->local_state());
RegisterAutofillRegexComponent(cus);
@ -1933,6 +1940,14 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
#if !defined(OS_ANDROID)
ChromeBrowsingDataLifetimeManagerFactory::GetInstance();
#endif
@@ -507,7 +505,6 @@ void ChromeBrowserMainExtraPartsProfiles::
SystemExtensionsProviderFactory::GetInstance();
#endif
TabRestoreServiceFactory::GetInstance();
- safe_browsing::TailoredSecurityServiceFactory::GetInstance();
TemplateURLFetcherFactory::GetInstance();
TemplateURLServiceFactory::GetInstance();
#if !defined(OS_ANDROID)
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc

View file

@ -77,13 +77,13 @@ See also: components/user_scripts/README.md
.../browser/resources/user-script-ui/BUILD.gn | 12 +
.../user-script-ui/user-scripts-ui.html | 14 +
.../user-script-ui/user-scripts-ui.js | 9 +
.../browser/ui/user_scripts_ui.cc | 148 ++++
.../user_scripts/browser/ui/user_scripts_ui.h | 39 +
.../browser/ui/user_scripts_ui.cc | 145 ++++
.../user_scripts/browser/ui/user_scripts_ui.h | 35 +
.../browser/user_script_loader.cc | 720 ++++++++++++++++
.../user_scripts/browser/user_script_loader.h | 171 ++++
.../user_scripts/browser/user_script_loader.h | 168 ++++
.../browser/user_script_pref_info.cc | 35 +
.../browser/user_script_pref_info.h | 73 ++
.../user_scripts/browser/user_script_prefs.cc | 287 +++++++
.../user_scripts/browser/user_script_prefs.cc | 285 +++++++
.../user_scripts/browser/user_script_prefs.h | 63 ++
.../browser/userscripts_browser_client.cc | 78 ++
.../browser/userscripts_browser_client.h | 62 ++
@ -94,53 +94,53 @@ See also: components/user_scripts/README.md
.../common/extension_message_generator.cc | 29 +
.../common/extension_message_generator.h | 11 +
.../user_scripts/common/extension_messages.cc | 40 +
.../user_scripts/common/extension_messages.h | 71 ++
.../user_scripts/common/extension_messages.h | 70 ++
components/user_scripts/common/host_id.cc | 31 +
components/user_scripts/common/host_id.h | 35 +
.../user_scripts/common/script_constants.h | 33 +
components/user_scripts/common/url_pattern.cc | 803 ++++++++++++++++++
components/user_scripts/common/url_pattern.h | 302 +++++++
.../user_scripts/common/url_pattern_set.cc | 335 ++++++++
.../user_scripts/common/url_pattern_set.h | 161 ++++
.../user_scripts/common/url_pattern_set.h | 158 ++++
components/user_scripts/common/user_script.cc | 327 +++++++
components/user_scripts/common/user_script.h | 409 +++++++++
components/user_scripts/common/user_script.h | 407 +++++++++
.../common/user_scripts_features.cc | 32 +
.../common/user_scripts_features.h | 34 +
components/user_scripts/common/view_type.cc | 39 +
components/user_scripts/common/view_type.h | 48 ++
components/user_scripts/renderer/BUILD.gn | 67 ++
.../renderer/extension_frame_helper.cc | 96 +++
.../renderer/extension_frame_helper.h | 92 ++
.../renderer/extension_frame_helper.h | 89 ++
.../user_scripts/renderer/injection_host.cc | 12 +
.../user_scripts/renderer/injection_host.h | 42 +
.../user_scripts/renderer/injection_host.h | 39 +
.../renderer/resources/greasemonkey_api.js | 82 ++
.../user_scripts_renderer_resources.grd | 14 +
.../user_scripts/renderer/script_context.cc | 215 +++++
.../user_scripts/renderer/script_context.h | 70 ++
.../user_scripts/renderer/script_injection.cc | 343 ++++++++
.../user_scripts/renderer/script_injection.h | 155 ++++
.../user_scripts/renderer/script_context.h | 67 ++
.../user_scripts/renderer/script_injection.cc | 341 ++++++++
.../user_scripts/renderer/script_injection.h | 152 ++++
.../renderer/script_injection_callback.cc | 25 +
.../renderer/script_injection_callback.h | 39 +
.../renderer/script_injection_callback.h | 36 +
.../renderer/script_injection_manager.cc | 417 +++++++++
.../renderer/script_injection_manager.h | 102 +++
.../renderer/script_injection_manager.h | 99 +++
.../user_scripts/renderer/script_injector.h | 96 +++
.../user_scripts/renderer/scripts_run_info.cc | 31 +
.../user_scripts/renderer/scripts_run_info.h | 70 ++
.../user_scripts/renderer/scripts_run_info.h | 67 ++
.../renderer/user_script_injector.cc | 228 +++++
.../renderer/user_script_injector.h | 87 ++
.../renderer/user_script_injector.h | 84 ++
.../user_scripts/renderer/user_script_set.cc | 262 ++++++
.../user_scripts/renderer/user_script_set.h | 102 +++
.../user_scripts/renderer/user_script_set.h | 99 +++
.../renderer/user_script_set_manager.cc | 77 ++
.../renderer/user_script_set_manager.h | 62 ++
.../renderer/user_script_set_manager.h | 61 ++
.../renderer/user_scripts_dispatcher.cc | 36 +
.../renderer/user_scripts_dispatcher.h | 48 ++
.../renderer/user_scripts_dispatcher.h | 47 +
.../renderer/user_scripts_renderer_client.cc | 105 +++
.../renderer/user_scripts_renderer_client.h | 36 +
.../renderer/user_scripts_renderer_client.h | 35 +
.../renderer/web_ui_injection_host.cc | 47 +
.../renderer/web_ui_injection_host.h | 29 +
.../renderer/web_ui_injection_host.h | 26 +
.../strings/userscripts_strings.grdp | 58 ++
tools/gritsettings/resource_ids.spec | 6 +
116 files changed, 9652 insertions(+), 2 deletions(-)
116 files changed, 9599 insertions(+), 2 deletions(-)
create mode 100644 components/user_scripts/README.md
create mode 100755 components/user_scripts/android/BUILD.gn
create mode 100644 components/user_scripts/android/java/res/drawable-hdpi/ic_check_24dp.png
@ -451,7 +451,7 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
namespace chrome {
void AddProfilesExtraParts(ChromeBrowserMainParts* main_parts) {
@@ -534,6 +536,7 @@ void ChromeBrowserMainExtraPartsProfiles::
@@ -533,6 +535,7 @@ void ChromeBrowserMainExtraPartsProfiles::
#endif
WebDataServiceFactory::GetInstance();
webrtc_event_logging::WebRtcEventLogManagerKeyedServiceFactory::GetInstance();
@ -1870,7 +1870,7 @@ new file mode 100644
+ mAddButton = (TextView) holder.findViewById(R.id.add_script);
+ mAddButton.setCompoundDrawablesRelativeWithIntrinsicBounds(
+ TintedDrawable.constructTintedDrawable(
+ getContext(), R.drawable.plus, R.color.default_control_color_active),
+ getContext(), R.drawable.plus, R.color.default_control_color_active_baseline),
+ null, null, null);
+ mAddButton.setOnClickListener(view -> {
+ UserScriptsBridge.SelectAndAddScriptFromFile(mWindowAndroid);
@ -2740,7 +2740,7 @@ diff --git a/components/user_scripts/browser/ui/user_scripts_ui.cc b/components/
new file mode 100644
--- /dev/null
+++ b/components/user_scripts/browser/ui/user_scripts_ui.cc
@@ -0,0 +1,148 @@
@@ -0,0 +1,145 @@
+/*
+ This file is part of Bromite.
+
@ -2763,7 +2763,6 @@ new file mode 100644
+
+#include "base/bind.h"
+#include "base/json/json_string_value_serializer.h"
+#include "base/macros.h"
+#include "base/memory/writable_shared_memory_region.h"
+#include "base/strings/string_util.h"
+#include "base/values.h"
@ -2802,8 +2801,6 @@ new file mode 100644
+ std::unique_ptr<user_scripts::UserScriptList> loaded_scripts_;
+
+ base::WeakPtrFactory<UserScriptsUIHandler> weak_factory_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(UserScriptsUIHandler);
+};
+
+UserScriptsUIHandler::UserScriptsUIHandler()
@ -2893,7 +2890,7 @@ diff --git a/components/user_scripts/browser/ui/user_scripts_ui.h b/components/u
new file mode 100644
--- /dev/null
+++ b/components/user_scripts/browser/ui/user_scripts_ui.h
@@ -0,0 +1,39 @@
@@ -0,0 +1,35 @@
+/*
+ This file is part of Bromite.
+
@ -2914,7 +2911,6 @@ new file mode 100644
+#ifndef USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
+#define USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_controller.h"
+
+namespace user_scripts {
@ -2925,15 +2921,11 @@ new file mode 100644
+ public:
+ explicit UserScriptsUI(content::WebUI* web_ui);
+ ~UserScriptsUI() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UserScriptsUI);
+};
+
+}
+
+#endif
\ No newline at end of file
diff --git a/components/user_scripts/browser/user_script_loader.cc b/components/user_scripts/browser/user_script_loader.cc
new file mode 100755
--- /dev/null
@ -3663,7 +3655,7 @@ diff --git a/components/user_scripts/browser/user_script_loader.h b/components/u
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/browser/user_script_loader.h
@@ -0,0 +1,171 @@
@@ -0,0 +1,168 @@
+/*
+ This file is part of Bromite.
+
@ -3690,7 +3682,6 @@ new file mode 100755
+
+#include "base/callback_forward.h"
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/memory/read_only_shared_memory_region.h"
+#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
@ -3828,8 +3819,6 @@ new file mode 100755
+ bool result, const std::string& error );
+
+ base::WeakPtrFactory<UserScriptLoader> weak_factory_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(UserScriptLoader);
+};
+
+} // namespace extensions
@ -3957,7 +3946,7 @@ diff --git a/components/user_scripts/browser/user_script_prefs.cc b/components/u
new file mode 100644
--- /dev/null
+++ b/components/user_scripts/browser/user_script_prefs.cc
@@ -0,0 +1,287 @@
@@ -0,0 +1,285 @@
+/*
+ This file is part of Bromite.
+
@ -4035,8 +4024,6 @@ new file mode 100644
+
+ private:
+ const std::string id_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrefUpdate);
+};
+
+bool GetInt64FromPref(const base::DictionaryValue* dict,
@ -4730,7 +4717,7 @@ diff --git a/components/user_scripts/common/extension_messages.h b/components/us
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/common/extension_messages.h
@@ -0,0 +1,71 @@
@@ -0,0 +1,70 @@
+// Copyright 2014 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.
@ -4748,7 +4735,6 @@ new file mode 100755
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/read_only_shared_memory_region.h"
+#include "base/values.h"
+#include "content/public/common/common_param_traits.h"
@ -6375,7 +6361,7 @@ diff --git a/components/user_scripts/common/url_pattern_set.h b/components/user_
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/common/url_pattern_set.h
@@ -0,0 +1,161 @@
@@ -0,0 +1,158 @@
+// Copyright (c) 2012 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.
@ -6389,7 +6375,6 @@ new file mode 100755
+#include <memory>
+#include <set>
+
+#include "base/macros.h"
+#include "url_pattern.h"
+
+class GURL;
@ -6527,8 +6512,6 @@ new file mode 100755
+ private:
+ // The list of URL patterns that comprise the extent.
+ std::set<URLPattern> patterns_;
+
+ DISALLOW_COPY_AND_ASSIGN(URLPatternSet);
+};
+
+std::ostream& operator<<(std::ostream& out,
@ -6873,7 +6856,7 @@ diff --git a/components/user_scripts/common/user_script.h b/components/user_scri
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/common/user_script.h
@@ -0,0 +1,409 @@
@@ -0,0 +1,407 @@
+// Copyright 2013 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.
@ -7263,8 +7246,6 @@ new file mode 100755
+
+ // Script cannot be enabled
+ bool force_disabled_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(UserScript);
+};
+
+// Information we need while removing scripts from a UserScriptLoader.
@ -7635,7 +7616,7 @@ diff --git a/components/user_scripts/renderer/extension_frame_helper.h b/compone
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/extension_frame_helper.h
@@ -0,0 +1,92 @@
@@ -0,0 +1,89 @@
+// Copyright 2013 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.
@ -7647,7 +7628,6 @@ new file mode 100755
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "content/public/renderer/render_frame_observer.h"
+#include "content/public/renderer/render_frame_observer_tracker.h"
@ -7721,8 +7701,6 @@ new file mode 100755
+ std::vector<base::OnceClosure> document_idle_callbacks_;
+
+ base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper);
+};
+
+} // namespace extensions
@ -7749,7 +7727,7 @@ diff --git a/components/user_scripts/renderer/injection_host.h b/components/user
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/injection_host.h
@@ -0,0 +1,42 @@
@@ -0,0 +1,39 @@
+// Copyright 2015 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.
@ -7757,7 +7735,6 @@ new file mode 100755
+#ifndef USERSCRIPTS_RENDERER_INJECTION_HOST_H_
+#define USERSCRIPTS_RENDERER_INJECTION_HOST_H_
+
+#include "base/macros.h"
+#include "../common/host_id.h"
+#include "url/gurl.h"
+
@ -7787,8 +7764,6 @@ new file mode 100755
+ private:
+ // The ID of the host.
+ HostID id_;
+
+ DISALLOW_COPY_AND_ASSIGN(InjectionHost);
+};
+
+#endif // USERSCRIPTS_RENDERER_INJECTION_HOST_H_
@ -8122,7 +8097,7 @@ diff --git a/components/user_scripts/renderer/script_context.h b/components/user
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/script_context.h
@@ -0,0 +1,70 @@
@@ -0,0 +1,67 @@
+// Copyright 2014 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.
@ -8137,7 +8112,6 @@ new file mode 100755
+
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "base/unguessable_token.h"
+#include "../common/script_constants.h"
@ -8186,8 +8160,6 @@ new file mode 100755
+ blink::WebLocalFrame* frame,
+ const GURL& document_url,
+ MatchOriginAsFallbackBehavior match_origin_as_fallback);
+
+// DISALLOW_COPY_AND_ASSIGN(ScriptContext);
+};
+
+} // namespace extensions
@ -8197,7 +8169,7 @@ diff --git a/components/user_scripts/renderer/script_injection.cc b/components/u
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/script_injection.cc
@@ -0,0 +1,343 @@
@@ -0,0 +1,341 @@
+// Copyright 2014 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.
@ -8210,7 +8182,6 @@ new file mode 100755
+#include "base/bind.h"
+#include "base/feature_list.h"
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/timer/elapsed_timer.h"
+#include "base/values.h"
@ -8326,8 +8297,6 @@ new file mode 100755
+ void OnDestruct() override { injection_->invalidate_render_frame(); }
+
+ ScriptInjection* injection_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameWatcher);
+};
+
+// static
@ -8483,7 +8452,8 @@ new file mode 100755
+ render_frame_->GetWebFrame()->RequestExecuteScript(
+ world_id, sources, is_user_gesture,
+ execution_option, callback.release(),
+ blink::BackForwardCacheAware::kPossiblyDisallow);
+ blink::BackForwardCacheAware::kPossiblyDisallow,
+ blink::WebLocalFrame::PromiseBehavior::kDontWait);
+}
+
+void ScriptInjection::OnJsInjectionCompleted(
@ -8545,7 +8515,7 @@ diff --git a/components/user_scripts/renderer/script_injection.h b/components/us
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/script_injection.h
@@ -0,0 +1,155 @@
@@ -0,0 +1,152 @@
+// Copyright 2014 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.
@ -8559,7 +8529,6 @@ new file mode 100755
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "../common/user_script.h"
+#include "injection_host.h"
@ -8694,8 +8663,6 @@ new file mode 100755
+ std::unique_ptr<FrameWatcher> frame_watcher_;
+
+ base::WeakPtrFactory<ScriptInjection> weak_ptr_factory_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(ScriptInjection);
+};
+
+} // namespace extensions
@ -8735,7 +8702,7 @@ diff --git a/components/user_scripts/renderer/script_injection_callback.h b/comp
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/script_injection_callback.h
@@ -0,0 +1,39 @@
@@ -0,0 +1,36 @@
+// Copyright 2015 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.
@ -8746,7 +8713,6 @@ new file mode 100755
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "third_party/blink/public/web/web_script_execution_callback.h"
+#include "v8/include/v8.h"
+
@ -8768,8 +8734,6 @@ new file mode 100755
+
+ private:
+ CompleteCallback injection_completed_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScriptInjectionCallback);
+};
+
+} // namespace extensions
@ -9201,7 +9165,7 @@ diff --git a/components/user_scripts/renderer/script_injection_manager.h b/compo
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/script_injection_manager.h
@@ -0,0 +1,102 @@
@@ -0,0 +1,99 @@
+#include <stdint.h>
+
+#include <map>
@ -9210,7 +9174,6 @@ new file mode 100755
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/scoped_observation.h"
+#include "../common/user_script.h"
+#include "script_injection.h"
@ -9299,8 +9262,6 @@ new file mode 100755
+
+ base::ScopedObservation<UserScriptSetManager, UserScriptSetManager::Observer>
+ user_script_set_manager_observation_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(ScriptInjectionManager);
+};
+
+}
@ -9445,7 +9406,7 @@ diff --git a/components/user_scripts/renderer/scripts_run_info.h b/components/us
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/scripts_run_info.h
@@ -0,0 +1,70 @@
@@ -0,0 +1,67 @@
+// Copyright 2014 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.
@ -9459,7 +9420,6 @@ new file mode 100755
+#include <set>
+#include <string>
+
+#include "base/macros.h"
+#include "base/timer/elapsed_timer.h"
+#include "../common/user_script.h"
+
@ -9509,8 +9469,6 @@ new file mode 100755
+
+ // The url of the frame, preserved for the same reason as the routing id.
+ GURL frame_url_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo);
+};
+
+} // namespace extensions
@ -9753,7 +9711,7 @@ diff --git a/components/user_scripts/renderer/user_script_injector.h b/component
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/user_script_injector.h
@@ -0,0 +1,87 @@
@@ -0,0 +1,84 @@
+// Copyright 2014 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.
@ -9764,7 +9722,6 @@ new file mode 100755
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "base/values.h"
+#include "base/scoped_observation.h"
+#include "../common/user_script.h"
@ -9834,8 +9791,6 @@ new file mode 100755
+
+ base::ScopedObservation<UserScriptSet, UserScriptSet::Observer>
+ user_script_set_observer_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(UserScriptInjector);
+};
+
+} // namespace extensions
@ -10112,7 +10067,7 @@ diff --git a/components/user_scripts/renderer/user_script_set.h b/components/use
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/user_script_set.h
@@ -0,0 +1,102 @@
@@ -0,0 +1,99 @@
+// Copyright 2014 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.
@ -10126,7 +10081,6 @@ new file mode 100755
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/read_only_shared_memory_region.h"
+#include "base/observer_list.h"
+#include "../common/user_script.h"
@ -10208,8 +10162,6 @@ new file mode 100755
+
+ // The associated observers.
+ base::ObserverList<Observer>::Unchecked observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserScriptSet);
+};
+
+} // namespace extensions
@ -10302,7 +10254,7 @@ diff --git a/components/user_scripts/renderer/user_script_set_manager.h b/compon
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/user_script_set_manager.h
@@ -0,0 +1,62 @@
@@ -0,0 +1,61 @@
+#ifndef USERSCRIPTS_RENDER_SET_MANAGER_H_
+#define USERSCRIPTS_RENDER_SET_MANAGER_H_
+
@ -10311,7 +10263,6 @@ new file mode 100755
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/read_only_shared_memory_region.h"
+#include "base/observer_list.h"
+#include "content/public/renderer/render_thread_observer.h"
@ -10365,7 +10316,6 @@ new file mode 100755
+}
+
+#endif
\ No newline at end of file
diff --git a/components/user_scripts/renderer/user_scripts_dispatcher.cc b/components/user_scripts/renderer/user_scripts_dispatcher.cc
new file mode 100755
--- /dev/null
@ -10412,7 +10362,7 @@ diff --git a/components/user_scripts/renderer/user_scripts_dispatcher.h b/compon
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/user_scripts_dispatcher.h
@@ -0,0 +1,48 @@
@@ -0,0 +1,47 @@
+#ifndef USERSCRIPTS_RENDER_DISPATCHER_H_
+#define USERSCRIPTS_RENDER_DISPATCHER_H_
+
@ -10428,7 +10378,6 @@ new file mode 100755
+#include <utility>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/scoped_observation.h"
+#include "content/public/renderer/render_thread_observer.h"
+#include "content/public/renderer/render_thread.h"
@ -10461,7 +10410,6 @@ new file mode 100755
+}
+
+#endif
\ No newline at end of file
diff --git a/components/user_scripts/renderer/user_scripts_renderer_client.cc b/components/user_scripts/renderer/user_scripts_renderer_client.cc
new file mode 100755
--- /dev/null
@ -10577,14 +10525,13 @@ diff --git a/components/user_scripts/renderer/user_scripts_renderer_client.h b/c
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/user_scripts_renderer_client.h
@@ -0,0 +1,36 @@
@@ -0,0 +1,35 @@
+#ifndef USERSCRIPTS_RENDER_CLIENT_H_
+#define USERSCRIPTS_RENDER_CLIENT_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "user_scripts_dispatcher.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
+
@ -10614,7 +10561,6 @@ new file mode 100755
+}
+
+#endif
\ No newline at end of file
diff --git a/components/user_scripts/renderer/web_ui_injection_host.cc b/components/user_scripts/renderer/web_ui_injection_host.cc
new file mode 100755
--- /dev/null
@ -10671,7 +10617,7 @@ diff --git a/components/user_scripts/renderer/web_ui_injection_host.h b/componen
new file mode 100755
--- /dev/null
+++ b/components/user_scripts/renderer/web_ui_injection_host.h
@@ -0,0 +1,29 @@
@@ -0,0 +1,26 @@
+// Copyright 2015 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.
@ -10679,7 +10625,6 @@ new file mode 100755
+#ifndef USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
+#define USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
+
+#include "base/macros.h"
+#include "injection_host.h"
+
+class WebUIInjectionHost : public InjectionHost {
@ -10696,8 +10641,6 @@ new file mode 100755
+ private:
+ GURL url_;
+ bool allow_insecure_csp_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebUIInjectionHost);
+};
+
+#endif // USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_

View file

@ -55,7 +55,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
} else if (PREF_AUTOFILL_ASSISTANT.equals(key)) {
mSharedPreferencesManager.writeBoolean(
ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, (boolean) newValue);
@@ -292,6 +298,11 @@ public class PrivacySettings
@@ -291,6 +297,11 @@ public class PrivacySettings
prefService.getBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED));
}

View file

@ -5,9 +5,9 @@ Subject: Move some account settings back to privacy settings
Search suggestions, autofill assistant and contextual search
---
.../java/res/xml/privacy_preferences.xml | 20 +++++++
.../privacy/settings/PrivacySettings.java | 60 ++++++++++++++++++-
.../privacy/settings/PrivacySettings.java | 59 ++++++++++++++++++-
.../strings/android_chrome_strings.grd | 4 ++
3 files changed, 83 insertions(+), 1 deletion(-)
3 files changed, 82 insertions(+), 1 deletion(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
@ -123,7 +123,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
} else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
AlwaysIncognitoLinkInterceptor.setAlwaysIncognito((boolean) newValue);
if (!mSnackbarManager.isShowing())
@@ -186,6 +234,16 @@ public class PrivacySettings
@@ -186,6 +234,15 @@ public class PrivacySettings
public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled";
@ -132,15 +132,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
+ * will the AA switch be assigned a value).
+ */
+ private boolean shouldShowAutofillAssistantPreference() {
+ return ChromeFeatureList.isEnabled(ChromeFeatureList.AUTOFILL_ASSISTANT)
+ && mSharedPreferencesManager.contains(
+ return mSharedPreferencesManager.contains(
+ ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED);
+ }
+
@Override
public void onResume() {
super.onResume();
@@ -196,7 +254,7 @@ public class PrivacySettings
@@ -196,7 +253,7 @@ public class PrivacySettings
* Updates the preferences.
*/
public void updatePreferences() {

View file

@ -23,7 +23,7 @@ The patch also includes tablet mode.
.../overlays/strip/StripLayoutHelper.java | 2 +-
.../strip/StripLayoutHelperManager.java | 33 ++++++++++--
.../scene_layer/StaticTabSceneLayer.java | 8 ++-
.../scene_layer/TabListSceneLayer.java | 19 ++++++-
.../scene_layer/TabListSceneLayer.java | 14 ++++++
.../scene_layer/TabStripSceneLayer.java | 15 +++++-
.../scene_layer/ToolbarSwipeSceneLayer.java | 10 +++-
.../browser/findinpage/FindToolbarTablet.java | 11 ++--
@ -44,7 +44,7 @@ The patch also includes tablet mode.
chrome/browser/flag_descriptions.h | 3 ++
.../flags/android/cached_feature_flags.cc | 18 +++++++
.../flags/android/chrome_feature_list.cc | 2 +
.../browser/flags/CachedFeatureFlags.java | 18 +++++++
.../browser/flags/CachedFeatureFlags.java | 19 +++++++
.../browser/flags/ChromeFeatureList.java | 2 +
.../omnibox/LocationBarCoordinator.java | 9 +++-
.../browser/omnibox/UrlBarCoordinator.java | 11 +++-
@ -64,7 +64,7 @@ The patch also includes tablet mode.
.../top/TopToolbarOverlayCoordinator.java | 7 +++
.../top/TopToolbarOverlayProperties.java | 8 ++-
.../toolbar/top/TopToolbarSceneLayer.java | 11 +++-
59 files changed, 609 insertions(+), 49 deletions(-)
59 files changed, 606 insertions(+), 48 deletions(-)
diff --git a/cc/base/features.cc b/cc/base/features.cc
--- a/cc/base/features.cc
@ -713,11 +713,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scen
// TODO(crbug.com/1070281): Use Supplier to get viewport and forward it to native, then
// updateLayer can become obsolete.
TabListSceneLayerJni.get().updateLayer(mNativePtr, TabListSceneLayer.this, tabListBgColor,
@@ -131,6 +140,12 @@ public class TabListSceneLayer extends SceneLayer {
@@ -131,6 +140,11 @@ public class TabListSceneLayer extends SceneLayer {
contentOffset = browserControls.getContentOffset();
}
+ int contentOffset = browserControls.getContentOffset();
+ if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
+ toolbarYOffset = 0;
+ contentOffset = 0;
@ -726,17 +725,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scen
// TODO(dtrainor, clholgat): remove "* dpToPx" once the native part fully supports dp.
TabListSceneLayerJni.get().putTabLayer(mNativePtr, TabListSceneLayer.this, t.getId(),
relatedTabIds, mUseAdditionalIds, R.id.control_container,
@@ -155,7 +170,9 @@ public class TabListSceneLayer extends SceneLayer {
t.getBrightness(), t.showToolbar(), defaultThemeColor,
t.getToolbarBackgroundColor(), closeButtonColor, t.anonymizeToolbar(),
t.isTitleNeeded(), urlBarBackgroundId, t.getTextBoxBackgroundColor(),
- t.getToolbarAlpha(), toolbarYOffset, contentOffset, t.getSideBorderScale(),
+ t.getToolbarAlpha(), toolbarYOffset,
+ /*contentOffset*/browserControls.getContentOffset(),
+ t.getSideBorderScale(),
t.insetBorderVertical());
}
TabListSceneLayerJni.get().finishBuildingFrame(mNativePtr, TabListSceneLayer.this);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
@ -1378,7 +1366,15 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -202,6 +202,23 @@ public class CachedFeatureFlags {
@@ -104,6 +104,7 @@ public class CachedFeatureFlags {
.put(ChromeFeatureList.FEED_LOADING_PLACEHOLDER, false)
.put(ChromeFeatureList.GRID_TAB_SWITCHER_FOR_TABLETS, false)
.put(ChromeFeatureList.TAB_GROUPS_FOR_TABLETS, false)
+ .put(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM, false)
.build();
/**
@@ -202,6 +203,23 @@ public class CachedFeatureFlags {
SharedPreferencesManager.getInstance().writeBoolean(preferenceName, isEnabledInNative);
}
@ -1402,7 +1398,7 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f
/**
* Forces a feature to be enabled or disabled for testing.
*
@@ -495,6 +512,7 @@ public class CachedFeatureFlags {
@@ -495,6 +513,7 @@ public class CachedFeatureFlags {
@NativeMethods
interface Natives {

View file

@ -41,7 +41,8 @@ Parts of this patch were developed by csagan5, uazo and others.
.../AppLanguagePreferenceDelegate.java | 8 -
.../language/settings/LanguageSettings.java | 6 -
.../prefetch/prefetch_service_factory.cc | 16 -
.../browser/password_manager/android/BUILD.gn | 6 +-
.../browser/password_manager/android/BUILD.gn | 2 -
...PasswordStoreAndroidBackendBridgeImpl.java | 7 -
.../push_messaging_service_factory.cc | 8 +-
chrome/browser/ui/BUILD.gn | 3 -
.../webui/chrome_web_ui_controller_factory.cc | 3 -
@ -95,7 +96,7 @@ Parts of this patch were developed by csagan5, uazo and others.
third_party/android_deps/BUILD.gn | 540 +-----------------
.../preconditions/javatests/BUILD.gn | 1 -
.../gms/ChromiumPlayServicesAvailability.java | 10 +-
74 files changed, 71 insertions(+), 2295 deletions(-)
75 files changed, 67 insertions(+), 2302 deletions(-)
delete mode 100644 components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java
delete mode 100644 components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java
@ -1031,19 +1032,38 @@ diff --git a/chrome/browser/password_manager/android/BUILD.gn b/chrome/browser/p
"//base:base_java",
"//chrome/browser/device_reauth/android:java",
"//chrome/browser/flags:java",
@@ -117,8 +116,11 @@ junit_binary("password_manager_junit_tests") {
deps = [
@@ -118,7 +117,6 @@ junit_binary("password_manager_junit_tests") {
":android_backend_java_enums",
":java",
+<<<<<<< found
":settings_interface_java",
- "$google_play_services_package:google_play_services_basement_java",
+||||||| expected
+=======
+>>>>>>> replacement
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackendBridgeImpl.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackendBridgeImpl.java
--- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackendBridgeImpl.java
+++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackendBridgeImpl.java
@@ -4,8 +4,6 @@
package org.chromium.chrome.browser.password_manager;
-import com.google.android.gms.common.api.ApiException;
-
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods;
@@ -113,11 +111,6 @@ class PasswordStoreAndroidBackendBridgeImpl {
error = ((PasswordStoreAndroidBackend.BackendException) exception).errorCode;
}
- if (exception instanceof ApiException) {
- error = AndroidBackendErrorType.EXTERNAL_ERROR;
- api_error_code = ((ApiException) exception).getStatusCode();
- }
-
PasswordStoreAndroidBackendBridgeImplJni.get().onError(
mNativeBackendBridge, jobId, error, api_error_code);
}
diff --git a/chrome/browser/push_messaging/push_messaging_service_factory.cc b/chrome/browser/push_messaging/push_messaging_service_factory.cc
--- a/chrome/browser/push_messaging/push_messaging_service_factory.cc
+++ b/chrome/browser/push_messaging/push_messaging_service_factory.cc

View file

@ -49,9 +49,9 @@ ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
.../chrome/browser/ntp/RecentTabsManager.java | 72 +------
.../browser/ntp/RecentTabsRowAdapter.java | 6 -
.../browser/omaha/RequestGenerator.java | 3 -
.../PasswordManagerLauncher.java | 9 -
.../PasswordManagerLauncher.java | 9 +-
.../settings/PasswordEntryViewer.java | 5 +-
.../settings/PasswordSettings.java | 29 +--
.../settings/PasswordSettings.java | 32 +---
.../privacy/settings/PrivacySettings.java | 30 ---
.../chrome/browser/settings/MainSettings.java | 135 +------------
.../browser/settings/SettingsActivity.java | 5 +-
@ -67,12 +67,13 @@ ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
...onfirmImportSyncDataDialogCoordinator.java | 6 +-
.../signin/ConfirmSyncDataStateMachine.java | 7 -
.../ui/signin/SignOutDialogFragment.java | 12 --
.../WebSigninAccountPickerDelegate.java | 18 --
.../ui/signin/fre/SigninFirstRunMediator.java | 24 +--
.../strings/android_chrome_strings.grd | 15 --
.../signin/SystemAccountManagerDelegate.java | 30 +--
.../net/HttpNegotiateAuthenticator.java | 88 +--------
.../chromoting/base/OAuthTokenFetcher.java | 2 -
53 files changed, 50 insertions(+), 1244 deletions(-)
54 files changed, 51 insertions(+), 1264 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
@ -1853,7 +1854,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.WindowAndroid;
@@ -28,14 +27,6 @@ public class PasswordManagerLauncher {
@@ -28,14 +27,8 @@ public class PasswordManagerLauncher {
*/
public static void showPasswordSettings(
Activity activity, @ManagePasswordsReferrer int referrer) {
@ -1863,8 +1864,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage
- PasswordScriptsFetcherBridge.prewarmCache();
- }
- CredentialManagerLauncher credentialManagerLauncher = null;
- PasswordManagerHelper.showPasswordSettings(activity, referrer, new SettingsLauncherImpl(),
PasswordManagerHelper.showPasswordSettings(activity, referrer, new SettingsLauncherImpl(),
- CredentialManagerLauncherFactory.getInstance().createLauncher(), syncService);
+ null, null);
}
@CalledByNative
@ -1955,7 +1957,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage
// Return true to notify the click was handled.
return true;
});
@@ -608,15 +592,6 @@ public class PasswordSettings extends PreferenceFragmentCompat
@@ -574,9 +558,6 @@ public class PasswordSettings extends PreferenceFragmentCompat
}
private void displayManageAccountLink() {
- if (!PasswordManagerHelper.isSyncingPasswordsWithNoCustomPassphrase(SyncService.get())) {
- return;
- }
if (mSearchQuery != null && !mNoPasswords) {
return; // Don't add the Manage Account link if there is a search going on.
}
@@ -608,15 +589,6 @@ public class PasswordSettings extends PreferenceFragmentCompat
return UserPrefs.get(Profile.getLastUsedRegularProfile());
}
@ -2657,6 +2669,61 @@ diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/brows
SignOutDialogListener targetFragment = (SignOutDialogListener) getTargetFragment();
targetFragment.onSignOutClicked(mWipeUserData != null && mWipeUserData.isChecked());
}
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/account_picker/WebSigninAccountPickerDelegate.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/account_picker/WebSigninAccountPickerDelegate.java
--- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/account_picker/WebSigninAccountPickerDelegate.java
+++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/account_picker/WebSigninAccountPickerDelegate.java
@@ -11,7 +11,6 @@ import org.chromium.base.Callback;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
-import org.chromium.chrome.browser.signin.services.SigninManager;
import org.chromium.chrome.browser.signin.services.WebSigninBridge;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.ui.signin.account_picker.AccountPickerBottomSheetCoordinator.EntryPoint;
@@ -28,7 +27,6 @@ public class WebSigninAccountPickerDelegate implements AccountPickerDelegate {
private final Tab mCurrentTab;
private final WebSigninBridge.Factory mWebSigninBridgeFactory;
private final String mContinueUrl;
- private final SigninManager mSigninManager;
private final IdentityManager mIdentityManager;
private @Nullable WebSigninBridge mWebSigninBridge;
@@ -43,8 +41,6 @@ public class WebSigninAccountPickerDelegate implements AccountPickerDelegate {
mCurrentTab = currentTab;
mWebSigninBridgeFactory = webSigninBridgeFactory;
mContinueUrl = continueUrl;
- mSigninManager = IdentityServicesProvider.get().getSigninManager(
- Profile.getLastUsedRegularProfile());
mIdentityManager = IdentityServicesProvider.get().getIdentityManager(
Profile.getLastUsedRegularProfile());
}
@@ -63,26 +59,12 @@ public class WebSigninAccountPickerDelegate implements AccountPickerDelegate {
// first before signing in again.
destroyWebSigninBridge();
// TODO(https://crbug.com/1133752): Revise sign-out reason
- mSigninManager.signOut(SignoutReason.ABORT_SIGNIN);
}
AccountInfoServiceProvider.get().getAccountInfoByEmail(accountEmail).then(accountInfo -> {
mWebSigninBridge =
mWebSigninBridgeFactory.create(Profile.getLastUsedRegularProfile(), accountInfo,
createWebSigninBridgeListener(
mCurrentTab, mContinueUrl, onSignInErrorCallback));
- mSigninManager.signin(AccountUtils.createAccountFromName(accountEmail),
- new SigninManager.SignInCallback() {
- @Override
- public void onSignInComplete() {
- // After the sign-in is finished in Chrome, we still need to wait for
- // WebSigninBridge to be called to redirect to the continue url.
- }
-
- @Override
- public void onSignInAborted() {
- WebSigninAccountPickerDelegate.this.destroyWebSigninBridge();
- }
- });
});
}
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
--- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
+++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java

View file

@ -7,7 +7,7 @@ This reverts commit ae458edcc8422d0815d0e82261e71fe10d7d6fc2.
Disable search-ready omnibox by default
---
chrome/browser/about_flags.cc | 5 ++++-
chrome/browser/about_flags.cc | 6 +++++-
chrome/browser/flag-metadata.json | 5 +++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
@ -15,7 +15,7 @@ Disable search-ready omnibox by default
chrome/browser/flags/android/chrome_feature_list.h | 1 +
.../chrome/browser/flags/ChromeFeatureList.java | 1 +
.../suggestions/DropdownItemViewInfoListBuilder.java | 10 ++++++++--
8 files changed, 31 insertions(+), 3 deletions(-)
8 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@ -30,16 +30,17 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
{"pull-to-refresh", flag_descriptions::kPullToRefreshName,
flag_descriptions::kPullToRefreshDescription, kOsAura,
MULTI_VALUE_TYPE(kPullToRefreshChoices)},
@@ -7709,6 +7709,9 @@ const FeatureEntry kFeatureEntries[] = {
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the
// AboutFlagsHistogramTest unit test to verify this process).
@@ -7698,6 +7698,10 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
chrome::android::kBookmarksExportUseSaf)},
+ {"enable-search-ready-omnibox", flag_descriptions::kSearchReadyOmniboxName,
+ flag_descriptions::kSearchReadyOmniboxDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(chrome::android::kSearchReadyOmniboxFeature)},
};
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
+
#if defined(OS_ANDROID)
{"use-ulp-languages-in-chrome",
flag_descriptions::kUseULPLanguagesInChromeName,
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

View file

@ -108,7 +108,7 @@ new file mode 100644
+ android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
+ app:drawableHeight="20sp"
+ app:drawableWidth="20sp"
+ app:chromeDrawableTint="@color/default_icon_color" />
+ app:chromeDrawableTint="@color/default_icon_color_light" />
+ </FrameLayout>
+
+ <FrameLayout
@ -132,7 +132,7 @@ new file mode 100644
+ android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
+ app:drawableHeight="20sp"
+ app:drawableWidth="20sp"
+ app:chromeDrawableTint="@color/default_icon_color" />
+ app:chromeDrawableTint="@color/default_icon_color_light" />
+ </FrameLayout>
+</LinearLayout>
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

View file

@ -18,12 +18,12 @@ to use the flag in the hamburger menu to navigate with a custom useragent leavin
.../PrivacyPreferencesManagerImpl.java | 42 ++++
.../settings/UserAgentPreferences.java | 188 ++++++++++++++++++
.../chromium/chrome/browser/tab/TabImpl.java | 70 +++++++
.../chromium/chrome/browser/tab/TabUtils.java | 28 +++
.../chromium/chrome/browser/tab/TabUtils.java | 16 ++
.../browser/android/content/content_utils.cc | 28 +++
.../preferences/browser_prefs_android.cc | 7 +
.../privacy_preferences_manager_impl.cc | 126 ++++++++++++
.../privacy_preferences_manager_impl.cc | 118 +++++++++++
.../preferences/ChromePreferenceKeys.java | 5 +
.../settings/PrivacyPreferencesManager.java | 16 ++
.../settings/PrivacyPreferencesManager.java | 8 +
.../org/chromium/chrome/browser/tab/Tab.java | 2 +
.../browser/tabmodel/TabWindowManager.java | 2 +
.../tabmodel/TabWindowManagerImpl.java | 18 ++
@ -38,7 +38,7 @@ to use the flag in the hamburger menu to navigate with a custom useragent leavin
.../browser/web_contents/web_contents_impl.cc | 4 +
.../framehost/NavigationControllerImpl.java | 3 +-
content/renderer/render_thread_impl.cc | 1 -
31 files changed, 770 insertions(+), 2 deletions(-)
31 files changed, 742 insertions(+), 2 deletions(-)
create mode 100644 chrome/android/java/res/layout/custom_useragent_preferences.xml
create mode 100644 chrome/android/java/res/xml/useragent_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/UserAgentPreferences.java
@ -607,7 +607,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav
+ NavigationController navigationController = webContents.getNavigationController();
+ navigationController.setUseDesktopUserAgent(
+ usingDesktopUserAgent, !this.isNativePage());
+ if (forcedByUser) this.setUserForcedUserAgent();
+ if (forcedByUser) CriticalPersistedTabData.from(this).setUserAgent(TabUserAgent.DESKTOP);
+ }
+ else if (this.getPendingLoadParams() != null) {
+ if (usingDesktopUserAgent) {
@ -640,30 +640,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUtils.ja
/**
* Collection of utility methods that operates on Tab.
*/
@@ -90,6 +94,10 @@ public class TabUtils {
@@ -90,6 +94,18 @@ public class TabUtils {
* @param forcedByUser Whether this was triggered by users action.
*/
public static void switchUserAgent(Tab tab, boolean switchToDesktop, boolean forcedByUser) {
+ SharedPreferencesManager.getInstance().writeBoolean(
+ ChromePreferenceKeys.USERAGENT_ALWAYS_DESKTOP_MODE, switchToDesktop);
+
+<<<<<<< found
final boolean reloadOnChange = !tab.isNativePage();
tab.getWebContents().getNavigationController().setUseDesktopUserAgent(
switchToDesktop, reloadOnChange);
@@ -97,6 +105,26 @@ public class TabUtils {
@TabUserAgent
int tabUserAgent = switchToDesktop ? TabUserAgent.DESKTOP : TabUserAgent.MOBILE;
if (ContentFeatureList.isEnabled(ContentFeatureList.REQUEST_DESKTOP_SITE_GLOBAL)
+||||||| expected
+ final boolean reloadOnChange = !tab.isNativePage();
+ tab.getWebContents().getNavigationController().setUseDesktopUserAgent(
+ switchToDesktop, reloadOnChange);
+ if (forcedByUser) ((TabImpl) tab).setUserForcedUserAgent();
+ }
+
+ /**
+=======
+ final boolean stickyDesktopModeEnabled = SharedPreferencesManager.getInstance().readBoolean(
+ ChromePreferenceKeys.USERAGENT_STICKY_DESKTOP_MODE, false);
+ if (stickyDesktopModeEnabled) {
@ -671,13 +654,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUtils.ja
+ } else {
+ tab.SetOverrideUserAgent(switchToDesktop, forcedByUser);
+ }
+ }
+ if ((true)) return;
+
+ /**
+>>>>>>> replacement
&& isDesktopSiteGlobalEnabled(Profile.fromWebContents(tab.getWebContents()))
== switchToDesktop) {
tabUserAgent = TabUserAgent.DEFAULT;
final boolean reloadOnChange = !tab.isNativePage();
tab.getWebContents().getNavigationController().setUseDesktopUserAgent(
switchToDesktop, reloadOnChange);
diff --git a/chrome/browser/android/content/content_utils.cc b/chrome/browser/android/content/content_utils.cc
--- a/chrome/browser/android/content/content_utils.cc
+++ b/chrome/browser/android/content/content_utils.cc
@ -749,7 +730,7 @@ diff --git a/chrome/browser/android/preferences/browser_prefs_android.cc b/chrom
diff --git a/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc b/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
--- a/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
+++ b/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
@@ -12,6 +12,31 @@
@@ -12,6 +12,30 @@
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/pref_service.h"
@ -777,20 +758,13 @@ diff --git a/chrome/browser/android/preferences/privacy_preferences_manager_impl
+using base::android::ScopedJavaGlobalRef;
+using base::android::ScopedJavaLocalRef;
+
+<<<<<<< found
namespace {
PrefService* GetPrefService() {
@@ -40,3 +65,104 @@ static jboolean JNI_PrivacyPreferencesManagerImpl_IsMetricsReportingManaged(
@@ -40,3 +64,97 @@ static jboolean JNI_PrivacyPreferencesManagerImpl_IsMetricsReportingManaged(
return GetPrefService()->IsManagedPreference(
metrics::prefs::kMetricsReportingEnabled);
}
+||||||| expected
+ : chrome_browser_net::NETWORK_PREDICTION_NEVER);
+}
+=======
+ : chrome_browser_net::NETWORK_PREDICTION_NEVER);
+}
+
+static void UpdateOverrideUserAgent() {
+ bool overrideUserAgentEnabled =
@ -885,7 +859,6 @@ diff --git a/chrome/browser/android/preferences/privacy_preferences_manager_impl
+ enabled);
+ UpdateOverrideUserAgent();
+}
+>>>>>>> replacement
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@ -911,19 +884,10 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro
diff --git a/chrome/browser/privacy/settings/java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManager.java b/chrome/browser/privacy/settings/java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManager.java
--- a/chrome/browser/privacy/settings/java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManager.java
+++ b/chrome/browser/privacy/settings/java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManager.java
@@ -71,8 +71,24 @@ public interface PrivacyPreferencesManager extends CrashReportingPermissionManag
/**
* @return Whether uploading usage metrics is currently permitted.
@@ -73,6 +73,14 @@ public interface PrivacyPreferencesManager extends CrashReportingPermissionManag
*/
+<<<<<<< found
boolean isMetricsUploadPermitted();
+||||||| expected
+ boolean isNetworkPredictionManaged();
+}
+=======
+ boolean isNetworkPredictionManaged();
+
+ void updateOverrideUserAgent();
+ boolean isOverrideUserAgentEnabled(boolean desktopMode);
+ void setOverrideUserAgentEnabled(boolean enabled, boolean desktopMode);
@ -931,8 +895,7 @@ diff --git a/chrome/browser/privacy/settings/java/src/org/chromium/chrome/browse
+ void setOverrideUserAgentValue(String timezone, boolean desktopMode);
+ boolean isDesktopModeViewportMetaEnabled();
+ void setDesktopModeViewportMetaEnabled(boolean enabled);
+}
+>>>>>>> replacement
+
/**
* @return Whether usage and crash reporting pref is enabled.
*/