This moves files that are directly copied over chromium resources to a separate directory where they are checked to make sure that there is a corresponding upstream file. This is the first step in a series of changes to clean up branding.js https://github.com/brave/brave-browser/issues/51969
* Add enable_brave_wallet GN variable and build flag
This adds a new GN build flag 'enable_brave_wallet' that can be set to
false to exclude Brave Wallet from the build. The flag is true by default
to maintain current behavior.
Changes include:
- Add enable_brave_wallet declare_args in build/config/BUILDCONFIG.gn
- Create brave_wallet/common/buildflags with ENABLE_BRAVE_WALLET flag
- Update all BUILD.gn and sources.gni files to use the new flag
- Add wallet buildflags dependencies via minimal one-line imports
* Add patches for wallet buildflags in Chromium BUILD files
Adds minimal one-line patches to import wallet buildflags dependencies
in Chromium source files. This allows Chromium code to conditionally
depend on wallet headers.
Patches:
- chrome/browser/ui/hid/BUILD.gn
- net/BUILD.gn
- third_party/blink/common/BUILD.gn
- third_party/blink/public/common/BUILD.gn
- third_party/blink/renderer/modules/permissions/BUILD.gn
* Guard wallet code in Chromium source overrides
Updates chromium_src overrides to conditionally compile wallet-related
code based on enable_brave_wallet flag. This includes:
- Adding DEPS files to allow buildflags dependencies
- Guarding wallet permission handling with #if BUILDFLAG(ENABLE_BRAVE_WALLET)
- Keeping wallet permission enum values unconditionally to maintain profile
interchangeability between wallet-enabled and wallet-disabled builds
- Updating component registration and preference handling
Key changes:
- Permission enums remain stable across build configs for UMA and persistence
- Wallet permission handling code only compiled when wallet enabled
- DEPS files updated to allow buildflags includes
* Guard wallet UI code in front-end TypeScript and Mojom
Conditionally compiles wallet-related UI code in TypeScript and Mojom
interfaces based on enable_brave_wallet preprocessor flag.
Changes:
- Settings menu: Use lastInserted pattern for menu item ordering
- Page visibility: Guard wallet page visibility checks
- Browser commands: Guard wallet command handling
- Routes: Conditionally include wallet routes
- Add non-null assertions for DOM insertions in TypeScript
- Update Mojom interfaces to conditionally include wallet enums
Front-end code uses <if expr="enable_brave_wallet"> preprocessor
directives to exclude wallet UI when the feature is disabled.
* Guard wallet usage in non-wallet Brave code
Conditionally compiles wallet-related code in non-wallet Brave files
based on enable_brave_wallet build flag.
Changes include:
- browser/: Guard wallet service factories, preferences, and helpers
- components/: Guard wallet dependencies in rewards, sidebar, and DNS
- renderer/: Conditionally register wallet content settings
- utility/: Guard wallet component registration
- ios/: Add optional chaining for wallet feature flags
- test/: Guard wallet-related test code
Key files:
- brave_stats_updater.cc: Guard wallet pref registration with #if
- brave_profile_prefs.cc: Conditionally register wallet preferences
- sidebar_service.cc: Guard wallet panel items
- iOS WalletConstants.swift: Use optional chaining for feature checks
This allows building Brave without wallet while maintaining profile
compatibility between wallet-enabled and wallet-disabled builds.
* Add static_assert for ENABLE_BRAVE_WALLET in wallet headers
Adds compile-time assertions to wallet headers to ensure they are only
included when wallet is enabled. This prevents accidental usage of wallet
APIs when enable_brave_wallet=false.
Added static_assert(BUILDFLAG(ENABLE_BRAVE_WALLET)) to:
browser/brave_wallet/ (11 files):
- asset_ratio_service_factory.h
- brave_wallet_context_utils.h
- brave_wallet_ipfs_service_factory.h
- brave_wallet_provider_delegate_impl.h
- brave_wallet_service_factory.h
- brave_wallet_tab_helper.h
- meld_integration_service_factory.h
- wallet_notification_service_factory.h
- simulation_service_factory.h
- swap_service_factory.h
- wallet_data_files_installer_delegate_impl.h
components/brave_wallet/browser/ (15 files):
- brave_wallet_p3a_private.h
- brave_wallet_prefs.h
- brave_wallet_service.h
- brave_wallet_utils.h
- ens_resolver_task.h
- json_rpc_service_test_utils.h
- json_rpc_service.h
- keyring_service_observer_base.h
- keyring_service.h
- network_manager.h
- permission_utils.h
- pref_names.h
- test_utils.h
- tx_service.h
- wallet_data_files_installer.h
components/brave_wallet/common/ (6 files):
- brave_wallet_types.h
- common_utils.h
- eth_abi_utils.h
- features.h
- hex_utils.h
- pref_names.h
Also includes minor wallet code updates to use buildflags and
guard zcash-specific test code.
* Follow up fixes after Parts 1-7
This fix ensures that YouTube videos on Android can properly handle the transition from fullscreen playback to Picture-in-Picture mode without interference from automatic screen orientation changes.
* AI Chat: Create a semi-built-in Profile for agentic features
For now, these features will only be useable in this profile. The purpose is for users and team members to experiment with these features, isolated from their regular browser context with existing site authentication. Whilst these features might evenutally be usable in a user's main profile under isolated storage (a built-in Container), this allows us to decouple these features from that behavior being implemented, as well as try out the separate Profile experience.
- Flag for whether the agentic behavior and the separate profile is enabled
- UI for the button in the AI Chat WebUI that will launch the profile
- Profile creation params, theme, and behavior:
- Doesn't cause the profile picker to be shown on browser startup
For subsequent PRs:
- A separate and basic NTP with messaging
- Content agent features
Upstream seems to have completed the whole migration to an opaque
`FrameTreeNodeId`. This change converts all the places that were using
an `int` still.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/e4de125f43660ff1f41e36fbff545c3bf2a7e401
commit e4de125f43660ff1f41e36fbff545c3bf2a7e401
Author: Avi Drissman <avi@chromium.org>
Date: Thu Sep 5 00:15:45 2024 +0000
Use an opaque type for FrameTreeNode IDs, part 15
content/public
Bug: 361344235
* Pass ShieldsSettings to renderer via mojo.
* Use switch to handle all ControlType values.
* Rename origins_to_allow_scripts_once to origins_to_allow_scripts.
* Cleanup RenderFrameHost interaction during ShieldsSettings passing.
* Extract GetFarblingLevel into a function.
* Use ShieldsSettings in WorkerContentSettingsClient.
* Replace WorkerContentSettingsClient patches with subclass.
* STT url override by speech_to_text:web_service_url feature param.
* Disabled speech recognition in Tor.
* Added Brave Service Key V2 for Speech to text.
- Convert lots of JS to typescript, although marked a lot of it as ts-nocheck as adding types would take a very very long time. To be done separately, hopefully with help!
- Upgrade many modules to polymer3
- Use chromium's build target for everything instead of duplicating a lot of build processes
- Do the same for everything that was served by chrome://brave-resources, now that it's easier to have the build system for chrome://resources take our additional files
TODO: Bring back manrope substitution for ru|el languages from brave_shared_resources_data_source.cc
* Reference to Manrope (Cyrillic & Greek) added for the Poppins font.
* License.
* Bye, bye 'Muli' it's a Poppin's time.
* Overrided Poppins with Manrope.
* Load font from resources instead of hardcode.
* Lint.
* GN fixed.
* Lint.
* Format.
* Clean up.
* Removed Mult files.
* Font weight fixes.
* Safety check padding.
* Font-weight on active state.
* Added comment.
* Update brave-ui ref to include https://github.com/brave/brave-ui/pull/607
- Remove Muli in favor of Poppins
* Rebase.
* Reverted package and package-lock jsons.
* Rebased.
* extra muli -> poppins text styles as a result of brave-ui update to remove muli from more places
Co-authored-by: Pete Miller <miller.pete@gmail.com>
Chromium change:
https://chromium.googlesource.com/chromium/src/+/36154304c4d53c584f308efa86e9682f222a18e9
commit 36154304c4d53c584f308efa86e9682f222a18e9
Author: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Date: Wed Aug 10 05:36:17 2022 +0000
webui: Remove deprecated GetMimeType(path)
Remove GetMimeType(const std::string& path) function now
that all overrides have been removed.
Also makes GetMimeType(const GURL& url) pure virtual.
Fixed: 1344742
This change corrects the constructors of several classes under
browser/, using clang-tidy's modernize-use-equals-default. Additionally,
this commit includes a few additional straggler files.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/39810e70da06baca176c0cdbc93164be1f980f59
commit 39810e70da06baca176c0cdbc93164be1f980f59
Author: Patrick Monette <pmonette@chromium.org>
Date: Thu Oct 14 18:06:59 2021 +0000
Reland "Move task-related files from base/ to base/task/"
This is a reland of 092c30c5fd4def5a0c63d6f3a8953bd07768dd44
The 2 problematic subrepos have been migrated and a couple late
addition of the old headers were migrated.
Original change's description:
> Move task-related files from base/ to base/task/
>
> The forward headers are updated to point to the new location, and the
> header guards were fixed.
>
> Bug: 1255932
Following https://github.com/brave/brave-browser/issues/15546, we
should also migrate BraveFrameMsg_AllowScriptsOnce to mojo (the only
legacy IPC method remaining in Brave) which, besides modernizing the
code, it also allows us to remove some bits that are no longer needed.
This change is covered by the following browser tests:
BraveShieldsAPIBrowserTest.AllowScriptsOnce
BraveShieldsAPIBrowserTest.AllowScriptsOnceDataURL
BraveShieldsAPIBrowserTest.AllowScriptsOnceIframe
Resolves https://github.com/brave/brave-browser/issues/15573
Similar to what I did recently when ChromeMsgStart was gone[1], we need
to pick some other value from the IPCMessageStart enumeration now that
FrameMsgStart is also gone, as we don't care about the value itself
but just about not having to patch Chromium if possible.
[1] https://github.com/brave/brave-core/commit/3192f679
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/81aadb4ae697123f1ac164d12e74d8542d888f56
commit 81aadb4ae697123f1ac164d12e74d8542d888f56
Author: Tom Sepez <tsepez@chromium.org>
Date: Mon Mar 15 19:26:54 2021 +0000
Remove unused IPC message ID FrameMsgStart.
The last usage was removed in
https://chromium-review.googlesource.com/c/chromium/src/+/2655126
This is slightly complicated since some message filters are now
mojo-only. These need a BrowserAssociatedInterface with an empty
vector of IPC message IDs to filter.
-- Remove DCHECK() for now-violated invariant.
-- Initialize some members in header while at it.
NOPRESUBMIT=true
Bug: chromium:1186832
Adapt Brave-specific code and overrides to use this equivalent struct.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/a696151783d69bc6e8884246418d771d06cd9f53
commit a696151783d69bc6e8884246418d771d06cd9f53
Author: dpapad <dpapad@chromium.org>
Date: Tue Feb 16 12:34:08 2021 +0000
WebuI: Delete GritResourceMap struct in favor of webui::ResourcePath.
- Move webui::ResourcePath definition to its own file in
ui/base/webui/.
- Modify Grit to use webui::ResourcePath, and delete the identical
GritResourceMap struct.
- Remove the AddResourcePathsBulk() override that used GritResourceMap.
This is in preparation of moving AddResourcePathsBulk to WebUIDataSource
itself.
Bug: 1176299
Chromium change:
https://chromium.googlesource.com/chromium/src/+/76ad70a295931ca8b0ff3613bd266b8fb34bc177
commit 76ad70a295931ca8b0ff3613bd266b8fb34bc177
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon May 18 16:08:12 2020 +0000
Reland "Move WebUI code to run on the UI thread."
This reverts commit 8f6d95238903920fbc13d3bc805f095a0a4c8df2.
Per analysis of all the waterfall bots that run this chrome_all_tast_tests, this doesn't affect the flakiness. Details in
https://bugs.chromium.org/p/chromium/issues/detail?id=1082326#c51
Original change's description:
> Revert moving WebUI code to run on the UI thread as there are still PFQ flakes.
>
> Revert "Reland "Move WebUI code to run on the UI thread only.""
>
> This reverts commit 52fd322ec1451094dfd5b2a82cabbc47e3839e30.
>
> Revert "Reland "Remove InstantIOContext since it's not needed anymore.""
>
> This reverts commit 6360b9fdb0023228011e4e872ea2831760dd03c5.
>
> Revert "Add extra thread hops in WebUI code on ChromeOS to simulate old timing."
>
> This reverts commit dbb65740f2e7d349218ed3be4838a5a9c7ce2986.
>
> Bug: 1082326, 1062873
BlinkTestHostMsg has been converted to Mojo. We used that IPC method
for
BraveViewHostMsg_JavaScriptBlocked,
BraveViewHostMsg_FingerprintingBlocked, and
BraveFrameMsg_AllowScriptsOnce
messages.
Changed our code to use ChromeMsgStart and FrameMsgStart.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/31755f407c3da7280224c677ce62768d8c858a50
commit 31755f407c3da7280224c677ce62768d8c858a50
Author: Gyuyoung Kim <gyuyoung@igalia.com>
Date: Thu Mar 12 10:27:02 2020 +0000
Convert BlinkTestHostMsg_PrintMessage to Mojo
This CL converts BlinkTestHostMsg_PrintMessage to BlinkTestClient
interface. But, BlinkTestRunner::PrintMessage needs to send a message
only when it's on the mainframe in order to sync with the existing
behavior. Like BlinkTestHostMsg_ResetDone conversion, this message
has been sent to the main frame. So, this CL moves |is_secondary_window|
from WebTestRenderFrameObserver to BlinkTestRunner.
Additionally, this CL removes blink_test_messages.h/cc files and related
things(e.g. BlinkTestMsgStart) finally.
Bug: 1039247, 1059322
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/39f4ff30f2078b6e7301fdbbfc2c23b84fa0538d
commit 39f4ff30f2078b6e7301fdbbfc2c23b84fa0538d
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Tue Oct 22 17:59:09 2019 +0000
Pass GURL to URLDataSource::StartDataRequest()
Bug: 991888
https://chromium.googlesource.com/chromium/src/+/f4b9e94bcc00bace773ea74d0801ba9a32beab8c
commit f4b9e94bcc00bace773ea74d0801ba9a32beab8c
Author: danakj <danakj@chromium.org>
Date: Fri Nov 29 15:43:04 2019 +0000
Convert Callback to {Once,Repeating}Callback in //content/browser.
Use OnceCallback where possible, and use BindRepeating() where it is
meant to be a RepeatingCallback.
Majority of this change is a few typedefs that are very widely used:
- LoadedCallback
- ValidateTokenCallback
- ValidateRegistrationCallback
- GotDataCallback**
** Especially this one.
Bug: 1007760
Chromium changes:
commit 516800beffb1c5dbe305cbd5291c1f2e5243c5a3
Author: dpapad <dpapad@chromium.org>
Date: Mon May 6 22:38:48 2019 +0000
Leverage DataPack::IsGzipped() from SharedResourcesDataSource.
The data sources that serve chrome://resources URLs were previously
relying on Grit's gzipped_resource_map_source output format. This is
no longer necessary since DataPack::IsGzipped() is exposed via the
content client API (or web client API on iOS).
Also reverting various grd files to use a normal resource_map_source
Grit output instead. The goal is to eventually
remove gzipped_resource_map_source output completely, since it should not be
necessary anymore (but there is more work needed to get there).
Bug: 738243
commit bca1b9759444b4717c63bd2f02f10997a45530aa
Author: dpapad <dpapad@chromium.org>
Date: Tue May 14 18:51:02 2019 +0000
Grit: Remove gzipped_resource_* output formats.
No longer used anywhere and not needed.
Bug: 961063
So far, brave only exposes flash when it is available.
Brave will use pdfium as a pdf viewer instead of pdf.js.
That causes plugins and mimeTypes will include pdf things.
That means we expose all that brave have.
So, we don't need to blacklist except flash plugins.
As indicated in the message below, these are now only intended for
tests. A review of our code using these may be needed.
Chromium change:
commit c113169ee60372b8fe17f0f449860032bf3b859d
Author: danakj <danakj@chromium.org>
Date: Thu Mar 28 15:19:05 2019 +0000
Move Shell messages to web_test and rename to BlinkTest.
These messages are only used by web_test/blink_test_{controller,runner}.
So move them into common/web_test, to indicate they are for tests not
content shell.
Also give them their own target so that test_runner can be made to use
them, since they are only for tests. I believe this would let us move
BlinkTestRunner into test_runner, and remove WebTestDelegate interface
out of content/shell/renderer.
R=avi@chromium.org
TBR=inferno
Bug: 866140
Adds a new UrlDataSource: BraveSharedResourcesDataSource whose purpose is to:
- Serve shared fonts and css for use in brave and chromium webui
- Host modules for chromium polymer-based webui
Enable client-side caching for chrome://brave-resources since nothing from this domain is profile-specific at the moment
commit b6f010b107495bd0487353edfb379c441c9969b6
Author: Hans Wennborg <hans@chromium.org>
Date: Thu Nov 22 07:26:07 2018 +0000
IPC_STRUCT_BEGIN: Don't explicitly default copy constructors etc
The classes may not actually be copyable, copy-assignable, etc. Previously the
compiler would not complain until trying to *use* the defaulted ctor/operator,
but the new -Wdefaulted-function-deleted warning warns about this up front.
(As a concrete example, ExtensionMsg_TabConnectionInfo isn't copy-assignable
because of base::DictionaryValue member, which is a base::Value, which can't
be copied.)
To ensure these structs are still movable, remove the user-declared destructor.
This is also a simplification in that it removes all the code that was necessary
to define that destructor out-of-line.