Skip to content

Commit b73a848

Browse files
authored
chromium patch upates (#217)
* Fix: disable new tab footer * fix: features.yaml update * feat: series per platoform * feat: import few essential patches from ungoogle-chromium * bump patch * clean-up: remove codex binary * fix: further fixes to hide customize toolbar * bump browseros version * fix: save ports from CLI even if browseros-server is disabled
1 parent 8ba6a24 commit b73a848

File tree

18 files changed

+495
-64
lines changed

18 files changed

+495
-64
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/components/search/ntp_features.cc b/components/search/ntp_features.cc
2+
index aeddd39776ffe..c25fe07db4ded 100644
3+
--- a/components/search/ntp_features.cc
4+
+++ b/components/search/ntp_features.cc
5+
@@ -234,7 +234,7 @@ BASE_FEATURE(kNtpMicrosoftAuthenticationModule,
6+
BASE_FEATURE(kNtpOneGoogleBarAsyncBarParts, base::FEATURE_DISABLED_BY_DEFAULT);
7+
8+
// If enabled, a footer will show on the NTP.
9+
-BASE_FEATURE(kNtpFooter, base::FEATURE_ENABLED_BY_DEFAULT);
10+
+BASE_FEATURE(kNtpFooter, base::FEATURE_DISABLED_BY_DEFAULT);
11+
12+
// If enabled, tab groups module will be shown.
13+
BASE_FEATURE(kNtpTabGroupsModule,

packages/browseros/build/config/copy_resources.yaml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -165,44 +165,44 @@ copy_operations:
165165
arch: ["x64"]
166166

167167
# Codex Binary - Platform & Architecture specific
168-
- name: "Codex Binary - macOS ARM64"
169-
source: "resources/binaries/codex/codex-aarch64-apple-darwin"
170-
destination: "chrome/browser/browseros_server/resources/bin/codex"
171-
type: "file"
172-
os: ["macos"]
173-
arch: ["arm64"]
174-
175-
- name: "Codex Binary - macOS x64"
176-
source: "resources/binaries/codex/codex-x86_64-apple-darwin"
177-
destination: "chrome/browser/browseros_server/resources/bin/codex"
178-
type: "file"
179-
os: ["macos"]
180-
arch: ["x64"]
181-
182-
- name: "Codex Binary - Linux ARM64"
183-
source: "resources/binaries/codex/codex-aarch64-unknown-linux-musl"
184-
destination: "chrome/browser/browseros_server/resources/bin/codex"
185-
type: "file"
186-
os: ["linux"]
187-
arch: ["arm64"]
188-
189-
- name: "Codex Binary - Linux x64"
190-
source: "resources/binaries/codex/codex-x86_64-unknown-linux-musl"
191-
destination: "chrome/browser/browseros_server/resources/bin/codex"
192-
type: "file"
193-
os: ["linux"]
194-
arch: ["x64"]
195-
196-
- name: "Codex Binary - Windows ARM64"
197-
source: "resources/binaries/codex/codex-aarch64-pc-windows-msvc.exe"
198-
destination: "chrome/browser/browseros_server/resources/bin/codex.exe"
199-
type: "file"
200-
os: ["windows"]
201-
arch: ["arm64"]
202-
203-
- name: "Codex Binary - Windows x64"
204-
source: "resources/binaries/codex/codex-x86_64-pc-windows-msvc.exe"
205-
destination: "chrome/browser/browseros_server/resources/bin/codex.exe"
206-
type: "file"
207-
os: ["windows"]
208-
arch: ["x64"]
168+
# - name: "Codex Binary - macOS ARM64"
169+
# source: "resources/binaries/codex/codex-aarch64-apple-darwin"
170+
# destination: "chrome/browser/browseros_server/resources/bin/codex"
171+
# type: "file"
172+
# os: ["macos"]
173+
# arch: ["arm64"]
174+
#
175+
# - name: "Codex Binary - macOS x64"
176+
# source: "resources/binaries/codex/codex-x86_64-apple-darwin"
177+
# destination: "chrome/browser/browseros_server/resources/bin/codex"
178+
# type: "file"
179+
# os: ["macos"]
180+
# arch: ["x64"]
181+
#
182+
# - name: "Codex Binary - Linux ARM64"
183+
# source: "resources/binaries/codex/codex-aarch64-unknown-linux-musl"
184+
# destination: "chrome/browser/browseros_server/resources/bin/codex"
185+
# type: "file"
186+
# os: ["linux"]
187+
# arch: ["arm64"]
188+
#
189+
# - name: "Codex Binary - Linux x64"
190+
# source: "resources/binaries/codex/codex-x86_64-unknown-linux-musl"
191+
# destination: "chrome/browser/browseros_server/resources/bin/codex"
192+
# type: "file"
193+
# os: ["linux"]
194+
# arch: ["x64"]
195+
#
196+
# - name: "Codex Binary - Windows ARM64"
197+
# source: "resources/binaries/codex/codex-aarch64-pc-windows-msvc.exe"
198+
# destination: "chrome/browser/browseros_server/resources/bin/codex.exe"
199+
# type: "file"
200+
# os: ["windows"]
201+
# arch: ["arm64"]
202+
#
203+
# - name: "Codex Binary - Windows x64"
204+
# source: "resources/binaries/codex/codex-x86_64-pc-windows-msvc.exe"
205+
# destination: "chrome/browser/browseros_server/resources/bin/codex.exe"
206+
# type: "file"
207+
# os: ["windows"]
208+
# arch: ["x64"]

packages/browseros/build/features.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ features:
318318
- chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.cc
319319
- chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h
320320
- chrome/common/pref_names.h
321-
ui fixes:
321+
ui-fixes:
322322
description: "patch: chromium ui fixes"
323323
files:
324324
- chrome/browser/chrome_content_browser_client.cc
@@ -329,10 +329,13 @@ features:
329329
- chrome/browser/ui/browser_ui_prefs.cc
330330
- chrome/browser/ui/views/chrome_layout_provider.cc
331331
- chrome/browser/ui/views/infobars/infobar_container_view.cc
332+
- chrome/browser/ui/views/new_tab_footer/
333+
- chrome/browser/ui/webui/new_tab_footer/
332334
- components/bookmarks/browser/bookmark_utils.cc
333335
- components/content_settings/core/browser/cookie_settings.cc
334336
- components/payments/core/payment_prefs.cc
335337
- components/performance_manager/user_tuning/prefs.cc
338+
- components/search/ntp_features.cc
336339
browseros-version:
337340
description: "patch: browseros version"
338341
files:

packages/browseros/build/modules/patches/series_patches.py

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ...common.module import CommandModule, ValidationError
1010
from ...common.context import Context
11-
from ...common.utils import log_info, log_success, log_error
11+
from ...common.utils import log_info, log_success, log_error, get_platform
1212

1313

1414
ENCODING = "UTF-8"
@@ -67,6 +67,32 @@ def parse_series(series_path: Path) -> Iterator[str]:
6767
yield line
6868

6969

70+
def get_series_files(series_dir: Path) -> list[Path]:
71+
"""
72+
Get all applicable series files for the current platform.
73+
74+
Returns series files in order:
75+
1. series (common, always applied)
76+
2. series.{platform} (platform-specific: windows, linux, macos)
77+
78+
Only returns files that exist.
79+
"""
80+
files = []
81+
82+
# Common series file (always)
83+
common = series_dir / "series"
84+
if common.exists():
85+
files.append(common)
86+
87+
# Platform-specific series file
88+
platform = get_platform() # "windows", "linux", or "macos"
89+
platform_file = series_dir / f"series.{platform}"
90+
if platform_file.exists():
91+
files.append(platform_file)
92+
93+
return files
94+
95+
7096
def apply_single_patch(patch_path: Path, chromium_src: Path) -> tuple[bool, str]:
7197
"""
7298
Apply a single patch using git apply.
@@ -120,7 +146,7 @@ def apply_series_patches_impl(
120146
dry_run: bool = False
121147
) -> tuple[list[Path], list[Path]]:
122148
"""
123-
Apply all patches listed in the series file.
149+
Apply all patches listed in series files (common + platform-specific).
124150
125151
Args:
126152
ctx: Build context
@@ -130,22 +156,31 @@ def apply_series_patches_impl(
130156
(applied_patches, failed_patches)
131157
"""
132158
series_dir = ctx.get_series_patches_dir()
133-
series_file = series_dir / "series"
134159
chromium_src = ctx.chromium_src
135160

136-
patch_paths = list(parse_series(series_file))
137-
total = len(patch_paths)
161+
series_files = get_series_files(series_dir)
162+
if not series_files:
163+
log_info(" No series files found")
164+
return [], []
165+
166+
# Collect all patches from all series files
167+
all_patches: list[tuple[str, Path]] = [] # (relative_path, series_file)
168+
for series_file in series_files:
169+
for relative_path in parse_series(series_file):
170+
all_patches.append((relative_path, series_file))
138171

172+
total = len(all_patches)
139173
if total == 0:
140-
log_info(" No patches listed in series file")
174+
log_info(" No patches listed in series files")
141175
return [], []
142176

143-
log_info(f" Found {total} patches in series file")
177+
platform = get_platform()
178+
log_info(f" Found {total} patches for platform '{platform}' across {len(series_files)} series file(s)")
144179

145180
applied = []
146181
failed = []
147182

148-
for i, relative_path in enumerate(patch_paths, 1):
183+
for i, (relative_path, series_file) in enumerate(all_patches, 1):
149184
patch_path = series_dir / relative_path
150185

151186
if not patch_path.exists():
@@ -154,7 +189,6 @@ def apply_series_patches_impl(
154189
continue
155190

156191
if dry_run:
157-
# Dry run: check if patch would apply
158192
cmd = [
159193
"git", "apply",
160194
"--check",

packages/browseros/chromium_patches/chrome/browser/browseros_server/browseros_server_manager.cc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/chrome/browser/browseros_server/browseros_server_manager.cc b/chrome/browser/browseros_server/browseros_server_manager.cc
22
new file mode 100644
3-
index 0000000000000..a53135fb1500f
3+
index 0000000000000..81ab3d65f5a38
44
--- /dev/null
55
+++ b/chrome/browser/browseros_server/browseros_server_manager.cc
6-
@@ -0,0 +1,1077 @@
6+
@@ -0,0 +1,1072 @@
77
+// Copyright 2024 The Chromium Authors
88
+// Use of this source code is governed by a BSD-style license that can be
99
+// found in the LICENSE file.
@@ -334,6 +334,11 @@ index 0000000000000..a53135fb1500f
334334
+ }
335335
+
336336
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
337+
+ // Initialize and finalize ports, even with browseros-server disabled
338+
+ // we want to update the prefs from CLI
339+
+ InitializePortsAndPrefs();
340+
+ SavePortsToPrefs();
341+
+
337342
+ if (command_line->HasSwitch("disable-browseros-server")) {
338343
+ LOG(INFO) << "browseros: BrowserOS server disabled via command line";
339344
+ return;
@@ -346,9 +351,6 @@ index 0000000000000..a53135fb1500f
346351
+
347352
+ LOG(INFO) << "browseros: Starting BrowserOS server";
348353
+
349-
+ // Initialize and finalize ports
350-
+ InitializePortsAndPrefs();
351-
+ SavePortsToPrefs();
352354
+
353355
+ // Start servers and process
354356
+ StartCDPServer();
@@ -1039,7 +1041,6 @@ index 0000000000000..a53135fb1500f
10391041
+}
10401042
+
10411043
+base::FilePath BrowserOSServerManager::GetBrowserOSExecutionDir() const {
1042-
+#if BUILDFLAG(IS_LINUX)
10431044
+ base::FilePath user_data_dir;
10441045
+ if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
10451046
+ LOG(ERROR) << "browseros: Failed to resolve DIR_USER_DATA path";
@@ -1059,12 +1060,6 @@ index 0000000000000..a53135fb1500f
10591060
+
10601061
+ LOG(INFO) << "browseros: Using execution directory: " << exec_dir;
10611062
+ return exec_dir;
1062-
+#else
1063-
+ // On Mac and Windows, use the resources path itself as execution directory
1064-
+ base::FilePath resources_path = GetBrowserOSServerResourcesPath();
1065-
+ LOG(INFO) << "browseros: Using resources path as execution directory: " << resources_path;
1066-
+ return resources_path;
1067-
+#endif
10681063
+}
10691064
+
10701065
+base::FilePath BrowserOSServerManager::GetBrowserOSServerExecutablePath() const {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/chrome/browser/ui/views/new_tab_footer/footer_controller.cc b/chrome/browser/ui/views/new_tab_footer/footer_controller.cc
2+
index fa4ddd420efdf..e52050341f8d6 100644
3+
--- a/chrome/browser/ui/views/new_tab_footer/footer_controller.cc
4+
+++ b/chrome/browser/ui/views/new_tab_footer/footer_controller.cc
5+
@@ -201,14 +201,7 @@ bool NewTabFooterController::ContentsViewFooterCotroller::
6+
7+
bool NewTabFooterController::ContentsViewFooterCotroller::
8+
ShouldShowExtensionFooter(const GURL& url) {
9+
- if (ShouldSkipForErrorPage()) {
10+
- return false;
11+
- }
12+
-
13+
- return ntp_footer::IsExtensionNtp(url, owner_->profile_) &&
14+
- owner_->profile_->GetPrefs()->GetBoolean(
15+
- prefs::kNTPFooterExtensionAttributionEnabled) &&
16+
- owner_->profile_->GetPrefs()->GetBoolean(prefs::kNtpFooterVisible);
17+
+ return false;
18+
}
19+
20+
void NewTabFooterController::UpdateFooterVisibilities(bool log_on_load_metric) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc
2+
index 94483bbb070cb..24509910918c0 100644
3+
--- a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc
4+
+++ b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc
5+
@@ -78,7 +78,7 @@ NewTabFooterUI::~NewTabFooterUI() = default;
6+
7+
// static
8+
void NewTabFooterUI::RegisterProfilePrefs(PrefRegistrySimple* registry) {
9+
- registry->RegisterBooleanPref(prefs::kNtpFooterVisible, true);
10+
+ registry->RegisterBooleanPref(prefs::kNtpFooterVisible, false);
11+
}
12+
13+
void NewTabFooterUI::BindInterface(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
BROWSEROS_MAJOR=0
22
BROWSEROS_MINOR=31
33
BROWSEROS_BUILD=0
4-
BROWSEROS_PATCH=1
4+
BROWSEROS_PATCH=3

packages/browseros/series_patches/series

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
#
1111
# Comments start with #
1212
# Inline comments: path/to/patch.patch # comment here
13+
14+
ungoogle-chromium/extensions-manifestv2.patch
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Linux-specific patches
2+
#
3+
# These patches are applied only when building on Linux.
4+
# Paths are relative to the series_patches directory.
5+

0 commit comments

Comments
 (0)