Skip to content

Commit

Permalink
[REBASE] Final patches for 131
Browse files Browse the repository at this point in the history
  • Loading branch information
uazo committed Nov 14, 2024
1 parent 0231a8b commit 1332fae
Show file tree
Hide file tree
Showing 39 changed files with 585 additions and 239 deletions.
23 changes: 12 additions & 11 deletions build/patches/Add-a-proxy-configuration-page.patch
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
chrome/browser/resources/proxy_config.html | 77 ++++
chrome/browser/resources/proxy_config.js | 278 +++++++++++++
chrome/browser/ui/BUILD.gn | 2 +
.../webui/chrome_web_ui_controller_factory.cc | 4 +
.../webui/chrome_web_ui_controller_factory.cc | 5 +-
chrome/browser/ui/webui/proxy_config_ui.cc | 389 ++++++++++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 31 ++
chrome/common/webui_url_constants.cc | 2 +
Expand All @@ -40,7 +40,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../proxy_config/proxy_policy_handler.cc | 2 +-
net/proxy_resolution/proxy_config.cc | 51 ++-
net/proxy_resolution/proxy_config.h | 3 +
25 files changed, 974 insertions(+), 17 deletions(-)
25 files changed, 974 insertions(+), 18 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
Expand Down Expand Up @@ -680,16 +680,17 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom
#include "chrome/browser/ui/webui/download_internals/download_internals_ui.h"
#include "chrome/browser/ui/webui/flags/flags_ui.h"
#include "chrome/browser/ui/webui/webui_util.h"
@@ -508,6 +509,9 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#endif // !BUILDFLAG(IS_ANDROID)

+ if (url.host_piece() == chrome::kChromeUIProxyConfigHost)
@@ -261,7 +262,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
history_clusters_internals::kChromeUIHistoryClustersInternalsHost) {
return &NewWebUI<HistoryClustersInternalsUI>;
}
-
+ if (url.host_piece() == chrome::kChromeUIProxyConfigHost) {
+ return &NewWebUI<ProxyConfigUI>;
+
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (page_url.host_piece() == chrome::kChromeUIOSSettingsHost)
return settings_utils::GetFaviconResourceBytes(scale_factor);
+ }
#if !BUILDFLAG(IS_ANDROID)
if (url.host_piece() == chrome::kChromeUINewTabHost) {
// The URL chrome://newtab/ can be either a virtual or a real URL,
diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webui/proxy_config_ui.cc
new file mode 100644
--- /dev/null
Expand Down
16 changes: 13 additions & 3 deletions build/patches/Add-an-always-incognito-mode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../browser/autocomplete_provider_client.cc | 4 +
.../browser/autocomplete_provider_client.h | 1 +
.../omnibox/browser/base_search_provider.cc | 2 +-
components/omnibox/browser/search_provider.cc | 4 +-
components/omnibox/browser/search_provider.cc | 7 +-
.../add-an-always-incognito-mode.inc | 13 ++
.../add-an-always-incognito-mode.inc | 1 +
.../add-an-always-incognito-mode.inc | 3 +
.../add-an-always-incognito-mode.inc | 1 +
65 files changed, 785 insertions(+), 112 deletions(-)
65 files changed, 787 insertions(+), 113 deletions(-)
create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java
Expand Down Expand Up @@ -1590,7 +1590,7 @@ diff --git a/chrome/browser/offline_pages/android/request_coordinator_factory.cc
+ return BrowserContextKeyedServiceFactory::GetBrowserContextToUse(context);
+ }
+
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+ return GetBrowserContextRedirectedInIncognito(context);
+}
+
+
Expand Down Expand Up @@ -2168,6 +2168,16 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/
((default_url && !default_url->suggestions_url().empty() &&
!*query_is_private) ||
(keyword_url && !keyword_url->suggestions_url().empty()));
@@ -937,7 +939,8 @@ std::unique_ptr<network::SimpleURLLoader> SearchProvider::CreateSuggestLoader(
// purpose of such a request is to signal the server to warm up; no info
// is required.
// Request for suggestions in OTR contexts is not allowed.
- DCHECK(!client()->IsOffTheRecord());
+ if (!client()->IsAlwaysIncognitoEnabled())
+ DCHECK(!client()->IsOffTheRecord());
return client()
->GetRemoteSuggestionsService(/*create_if_necessary=*/true)
->StartSuggestionsRequest(
diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-an-always-incognito-mode.inc b/cromite_flags/chrome/browser/about_flags_cc/add-an-always-incognito-mode.inc
new file mode 100644
--- /dev/null
Expand Down
31 changes: 5 additions & 26 deletions build/patches/Add-bookmark-import-export-actions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../bookmarks/BookmarkToolbarViewBinder.java | 6 +
.../native_page/NativePageFactory.java | 11 +-
chrome/browser/BUILD.gn | 11 +-
.../bookmarks/android/bookmark_bridge.cc | 282 +++++++++++++++++
.../bookmarks/android/bookmark_bridge.cc | 277 +++++++++++++++++
.../bookmarks/android/bookmark_bridge.h | 29 +-
.../browser/bookmarks/bookmark_html_writer.cc | 11 +
.../browser/bookmarks/bookmark_html_writer.cc | 3 +
.../dialogs/DownloadLocationCustomView.java | 8 +-
.../DownloadLocationDialogCoordinator.java | 10 +-
.../flags/android/chrome_feature_list.cc | 1 +
Expand All @@ -53,7 +53,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
ui/shell_dialogs/select_file_dialog_linux.cc | 4 +
ui/shell_dialogs/select_file_dialog_linux.h | 2 +
ui/shell_dialogs/select_file_dialog_win.cc | 5 +
42 files changed, 913 insertions(+), 30 deletions(-)
42 files changed, 900 insertions(+), 30 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-bookmark-import-export-actions.inc
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-bookmark-import-export-actions.inc
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/add-bookmark-import-export-actions.inc
Expand Down Expand Up @@ -987,7 +987,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse
}

void BookmarkBridge::Destroy(JNIEnv* env) {
@@ -767,6 +878,177 @@ jint BookmarkBridge::GetTotalBookmarkCount(
@@ -767,6 +878,172 @@ jint BookmarkBridge::GetTotalBookmarkCount(
return count;
}

Expand Down Expand Up @@ -1078,12 +1078,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse
+}
+
+const std::string BookmarkBridge::FileSelectedImpl(const base::FilePath& path) {
+ base::File file;
+ if (path.IsContentUri()) {
+ file = base::OpenContentUri(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
+ } else {
+ file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
+ }
+ base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
+ if (!file.IsValid()) {
+ select_file_dialog_->ShowToast("Cannot open bookmarks file for import");
+ return "";
Expand Down Expand Up @@ -1266,22 +1261,6 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -240,7 +243,15 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
// Opens the file, returning true on success.
bool OpenFile() {
int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE;
+#if BUILDFLAG(IS_ANDROID)
+ if (path_.IsContentUri()) {
+ file_ = std::make_unique<base::File>(base::OpenContentUriForWrite(path_));
+ } else {
+ file_ = std::make_unique<base::File>(path_, flags);
+ }
+#else
file_ = std::make_unique<base::File>(path_, flags);
+#endif
if (!file_->IsValid()) {
PLOG(ERROR) << "Could not create " << path_;
return false;
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
Expand Down
88 changes: 83 additions & 5 deletions build/patches/Add-cromite-flags-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
base/BUILD.gn | 4 +-
base/android/feature_map.cc | 5 +
.../base/cached_flags/ValuesReturned.java | 2 +-
base/feature_list.cc | 76 ++++++++
base/feature_list.h | 72 +++++++-
build/android/gyp/java_cpp_features.py | 17 ++
Expand Down Expand Up @@ -53,13 +54,15 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
components/flags_ui/resources/app.ts | 23 +++
components/flags_ui/resources/experiment.css | 7 +-
.../flags_ui/resources/experiment.html.ts | 7 +-
components/flags_ui/resources/experiment.ts | 9 +-
components/flags_ui/resources/experiment.ts | 14 +-
.../flags_ui/resources/flags_browser_proxy.ts | 5 +
.../core/offline_page_feature.cc | 1 +
.../offline_pages/core/offline_page_feature.h | 1 +
.../browser/features/password_features.cc | 1 +
components/permissions/features.cc | 1 +
.../version_ui/version_handler_helper.cc | 2 +-
...nthetic_trials_active_group_id_provider.cc | 4 +-
...ynthetic_trials_active_group_id_provider.h | 4 +-
.../version_ui/version_handler_helper.cc | 4 +-
content/common/features.cc | 1 +
content/public/common/content_features.cc | 1 +
content/public/common/content_features.h | 1 +
Expand Down Expand Up @@ -99,7 +102,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
third_party/blink/public/common/features.h | 1 +
ui/base/ui_base_features.cc | 1 +
ui/base/ui_base_features.h | 1 +
86 files changed, 781 insertions(+), 22 deletions(-)
89 files changed, 792 insertions(+), 28 deletions(-)
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp
Expand Down Expand Up @@ -168,6 +171,18 @@ diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc
FeatureMap* feature_map = reinterpret_cast<FeatureMap*>(jfeature_map);
const base::Feature* feature =
feature_map->FindFeatureExposedToJava(feature_name);
diff --git a/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java b/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java
--- a/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java
+++ b/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java
@@ -16,7 +16,7 @@ import java.util.Map;
/** Keeps track of values returned for cached flags and field trial parameters. */
public abstract class ValuesReturned {
@GuardedBy("sBoolValues")
- private static final Map<String, Boolean> sBoolValues = new HashMap<>();
+ public static final Map<String, Boolean> sBoolValues = new HashMap<>();

@GuardedBy("sStringValues")
private static final Map<String, String> sStringValues = new HashMap<>();
diff --git a/base/feature_list.cc b/base/feature_list.cc
--- a/base/feature_list.cc
+++ b/base/feature_list.cc
Expand Down Expand Up @@ -789,7 +804,7 @@ new file mode 100644
+import java.util.ArrayList;
+import java.util.List;
+
+import org.chromium.base.cached_flags.CachedFlag;
+import org.chromium.components.cached_flags.CachedFlag;
+
+{IMPORT_CLAUSE}
+
Expand Down Expand Up @@ -1352,7 +1367,19 @@ diff --git a/components/flags_ui/resources/experiment.html.ts b/components/flags
diff --git a/components/flags_ui/resources/experiment.ts b/components/flags_ui/resources/experiment.ts
--- a/components/flags_ui/resources/experiment.ts
+++ b/components/flags_ui/resources/experiment.ts
@@ -127,12 +127,15 @@ export class ExperimentElement extends CrLitElement {
@@ -81,6 +81,11 @@ export class ExperimentElement extends CrLitElement {
enabled: false,
is_default: false,
supported_platforms: [],
+ is_default_value_on: false,
+ default_value: '',
+ is_cromite: false,
+ is_new: false,
+ permalink: true,
};

// Whether the controls to change the experiment state should be hidden.
@@ -127,12 +132,15 @@ export class ExperimentElement extends CrLitElement {
}

protected getExperimentTitle_(): string {
Expand Down Expand Up @@ -1426,9 +1453,60 @@ diff --git a/components/permissions/features.cc b/components/permissions/feature
} // namespace features
namespace feature_params {

diff --git a/components/variations/synthetic_trials_active_group_id_provider.cc b/components/variations/synthetic_trials_active_group_id_provider.cc
--- a/components/variations/synthetic_trials_active_group_id_provider.cc
+++ b/components/variations/synthetic_trials_active_group_id_provider.cc
@@ -27,7 +27,7 @@ SyntheticTrialsActiveGroupIdProvider::GetActiveGroupIds() {
return group_ids_;
}

-#if !defined(NDEBUG)
+#if true
std::vector<SyntheticTrialGroup>
SyntheticTrialsActiveGroupIdProvider::GetGroups() {
base::AutoLock scoped_lock(lock_);
@@ -53,7 +53,7 @@ void SyntheticTrialsActiveGroupIdProvider::OnSyntheticTrialsChanged(
for (const auto& group : groups) {
group_ids_.push_back(group.id());
}
-#if !defined(NDEBUG)
+#if true
groups_ = groups;
#endif // !defined(NDEBUG)
}
diff --git a/components/variations/synthetic_trials_active_group_id_provider.h b/components/variations/synthetic_trials_active_group_id_provider.h
--- a/components/variations/synthetic_trials_active_group_id_provider.h
+++ b/components/variations/synthetic_trials_active_group_id_provider.h
@@ -36,7 +36,7 @@ class COMPONENT_EXPORT(VARIATIONS) SyntheticTrialsActiveGroupIdProvider
// Returns currently active synthetic trial group IDs.
std::vector<ActiveGroupId> GetActiveGroupIds();

-#if !defined(NDEBUG)
+#if true
// In debug mode, not only the group IDs are tracked but also the full group
// info, to display the names unhashed in chrome://version.
std::vector<SyntheticTrialGroup> GetGroups();
@@ -60,7 +60,7 @@ class COMPONENT_EXPORT(VARIATIONS) SyntheticTrialsActiveGroupIdProvider

base::Lock lock_;
std::vector<ActiveGroupId> group_ids_; // GUARDED_BY(lock_);
-#if !defined(NDEBUG)
+#if true
// In debug builds, keep the full group information to be able to display it
// in chrome://version.
std::vector<SyntheticTrialGroup> groups_; // GUARDED_BY(lock_);
diff --git a/components/version_ui/version_handler_helper.cc b/components/version_ui/version_handler_helper.cc
--- a/components/version_ui/version_handler_helper.cc
+++ b/components/version_ui/version_handler_helper.cc
@@ -20,7 +20,7 @@
namespace version_ui {
namespace {

-#if !defined(NDEBUG)
+#if true
std::string GetActiveGroupNameAsString(
const base::FieldTrial::ActiveGroup& group) {
static const unsigned char kNonBreakingHyphenUTF8[] = {0xE2, 0x80, 0x91,
@@ -56,7 +56,7 @@ base::Value::List GetVariationsList() {
base::FieldTrialListIncludingLowAnonymity::GetActiveFieldTrialGroups(
&active_groups);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ new file mode 100644
+
+package org.chromium.chrome.browser.flags.cromite;
+
+import org.chromium.base.cached_flags.CachedFlag;
+import org.chromium.components.cached_flags.CachedFlag;
+import org.chromium.chrome.browser.flags.ChromeFeatureMap;
+
+public class sAllowExternalIntentRequests {
Expand Down
Loading

0 comments on commit 1332fae

Please sign in to comment.