* [iOS] Add ability to enable Brave admin policies on iOS
This change also adds the an example of handling the BraveWalletDisabled policy
* fixed code checks
* update property name; bump to cr139 min; other review feedback
* remove patch, update override
* remove unused DEPS file
* update wallet policy unit test since ios now runs component unit tests
* re-add android buildflag check to brave_wallet IsDisabledByPolicy
This PR runs a mechanical change to do IWYU on all files using the new
abseil functions, while also removing the old header inclusions for
`base::StringPrintf`.
A presubmit `BanRule` is also being added for the `base::` functions.
Resolves https://github.com/brave/brave-browser/issues/48143
This PR is the run of `gn format` on all `gn` files. This is a
mechanical change done with:
```sh
git ls-files -- "*.gn" | xargs gn format
git ls-files -- "*.gni" | xargs gn format
```
This change has been motivated primarily by an improvement to the
formatters privided by `gn` correcting cases of redundant target naming,
i.e cases where `//foo:foo` is used, and should just be `//foo`.
For this particular `gn` change, see:
https://chromium.googlesource.com/chromium/src/+/c822490a82cdb6ad479159683a92858f7c6f0a58
Resolves https://github.com/brave/brave-browser/issues/48161
Fix cookie sharing in split view context menu with proper SameSite handling
This commit addresses cookie sharing issues when opening links in split view
via context menu by implementing proper initiator handling to respect
SameSite cookie attributes.
Key changes:
Cookie Security Fix:
- Modified "Open link in split view" context menu to use OpenURLParams with
proper initiator context instead of simple GURL
- Ensures SameSite=Strict cookies are not shared across different origins
when opening links in split view from context menu with test coverage
Implementation Details:
- Extended OpenLinkInSplitView() function signature to accept full
OpenURLParams instead of just GURL
- Previously, we opened a empty tab and then navigation was performed.
This is suspected to be the cause of cookie sharing issues, as we don't
give any hint about initiator.
Resolves https://github.com/brave/brave-browser/issues/47642
This PR has additional replacements for base::StringPrintf with the
underlying abseil implementation absl::StrFormat.
This is mostly a mechanical change.
Resolves https://github.com/brave/brave-browser/issues/48076
* Increase maximum amount of custom images to 48
* Update Settings top navigation to match latest designs
* Use correct tokens
* Update styles to use the right tokens
* Updated styling of top bar
* remove shadow from active state
Currently when trying to do right-click actions in PDF, it would fail
silently because it can't get a tab helper due to tab_helper won't be
installed in guest WebContents (PDF plugin). embedder_web_contents
should be used instead to access the tab helper, which is done in this
PR.
This PR also makes a change to not try rewrite-in-place for PDF case.
Current impl doesn't work for PDF since web_contents.Replace doesn't
work, so we should just go for regular panel operation in this case for
now.
Also, when error happens, we currently try to open AI chat panel using
source_web_contents_, which is incorrect, it should be
embedder_web_contents_. However, in this PR, we just won't go into
rewrite-in-place code path for PDF cases, hence no need to change
source_web_contents_ to embedder_web_contents_ inside this path.
Test coverage are also improved for both PDF and non-PDF cases.
Sets the zorder for permission prompt bubble to kSecuritySurface, so that it
appears above other UI elements even they are floating on top.For example,
Picture-in-Picture window is on top of other widgets, but permission prompt
bubble should still be on top of it.
Those methods just return the value from TLS and do not read from the
object any more. Hence they should be replaced by
`v8::Isolate::GetCurrent()`.
Resolves https://github.com/brave/brave-browser/issues/48040
* [Linux] Fixes search engines not persisting for locale.
On Linux, unlike other platforms, RegionalCapabilitiesServiceClientLinux::FetchCountryId
only relies on variations service to retrieve the locale. On the initial run, there's no
valid locale set from the variations service and the regional capabilities service falls
back on the device locale. On the consecutive runs the locale is retrieved from the
variations service and causes the search engines selection to change as well. This makes
little sense since the user would likely prefer to retain the same set of search engines
regardless of their physical location.
This change overrides RegionalCapabilitiesServiceClientLinux::FetchCountryId to use the
platform-neutral implementation in RegionalCapabilitiesServiceClient that gets the locale
from the device.
* Disable failing upstream tests.
* Add a browser test to check capabilities service uses device locale.
Resolvesbrave/brave-browser#47836
WebDiscoveryInfoBarContentView should be the direct children as it occupies whole InfoBarView bounds.
Upstream prevent to call AddChildView() from InfoBarView's sub class. but we need it.
Fixed by using friend class WebDiscoveryInfoBarContentView.
TEST=WebDiscoveryTest.InfobarAddedTest
This commit extends the toolbar customization feature to support
Brave Rewards placement in the url bar by introducing a new "Url bar" category
and implementing the necessary infrastructure.
Key changes:
- Add new "Url bar" category (CategoryId::kUrlBar) to organize url bar-specific actions
- Implement kShowReward action for toggling Brave Rewards visibility
- Integrate Brave Rewards with existing preference system (brave_rewards::prefs::kShowLocationBarButton)
- Add dynamic category management that only shows "Url bar" category when
Brave Rewards is supported for the current profile
Technical implementation:
- Extended customize_toolbar.mojom with new ActionId::kShowReward and
CategoryId::kUrlBar enums
- Implemented AppendBraveSpecificCategories() function to conditionally
add Url bar category based on Brave Rewards availability
- Enhanced list action modifiers to handle URL bar actions alongside existing
navigation actions
- Added comprehensive unit tests covering both enabled and disabled states
for Brave Rewards
<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/47820
<img width="332" height="189" alt="image" src="https://github.com/user-attachments/assets/af8b7b9b-03e2-4451-8a34-df6ae797cce6" />
- Revert notes
The original change was having no effect because we were subclassing
`PageInfoCookiesContentView`, in order to avoid patching, however
`PageInfoCookiesContentView` does virtual dispatch calls in its
constructor, and in such cases the derived implementation is entirely
ignored.
This change corrects this issue with a combination of a patch and
overrides now. Additionally, tests are being added to confirm that the
changes work correctly.
Finally, a dangling pointer case was detected and also corrected.
Revert: https://github.com/brave/brave-core/pull/30276
Original desc:
This override was doing a copy of the value passed in, `cookie_info`,
and then changing the value of one of the fields to `kHide`, in order to
make things work properly for the rest of the things done by the
override, and avoid a `CHECK`. The issue here is that `cookie_info` is a
`const` reference, and `cookie_info` have a copy constructor, so the
fields were being copied manually. This worked for a short time, until
other fields were added to this struct, with some being uninitialised.
This change removes the whole copying of this type, as that is
bug-prone, with new fields being added, and rather overrides
`SetThirdPartyCookiesInfo` to always bail out, as this is the actual
effect we are looking for by mutating the value of `cookie_info`.
`SetThirdPartyCookiesInfo` is only used by `SetCookieInfo` in fact.
Resolves https://github.com/brave/brave-browser/issues/47875
Resolvesbrave/brave-browser#47896
Reload button reloads tabs that currently selected tabs.
With SideBySide, all split tabs(left & right) are added in selected tab when it's activated.
So, both split tabs are all reloaded. But we only want to reload active split tab.
It's difficult to touch selection model because it's related whole split tabs behavior.
To resolve this, inactive split tab is removed from selected tabs in chrome::ReloadInternal()
when only that split tabs is selected.
TEST=SplitViewWithTabDialogBrowserTest.SplitViewReloadTest
As a first step towards implementing tree tabs, this commit introduces
the `TreeTabNode` class. This class extends the `TabCollection` interface
and represents a node in a tree structure of tabs. It can hold a current
tab and supports child collections, such as other `TreeTabNode`,
`TabGroupTabCollections`, and `SplitTabCollections` recursively.
<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/47695
Resolvesbrave/brave-browser#46491
When SideBySide is enabled, BraveMultiContentsView owns each contents views(BraveContentsContainerView).
BraveContentsContainerView covers whole each split view area and it controls split view activation border.
So, ReaderModeToolbarView also should be included in BraveContentsContainerView.
As this is same behaviour with our split view implementation, existing test case can verify this PR's change.
TEST=SpeedReaderWithSplitViewBrowserTest.*
This change fixes an uninitialised read in `BraveGCMDriverDesktop`, as
the `enabled_`, which can happen to be read in some cases.
Resolves https://github.com/brave/internal/issues/1368
* Preparing extensions mv2 settings import implementation.
Brave-hosted extensions metadata is moved to brave_hosted_extensions.h/.cc
Feature declaration is moved to features.h/.cc, introduced three feature params.
This change updates how brave/chromium_src overrides can reference original files: it adds ability to use #include <...> along with #include "src/...". This is enabled by replacing -I../../brave/chromium_src with -iquote../../brave_chromium_src, which adds an include search path only for #include "..." directives.
With this approach, other files in the build tree can reference brave/chromium_src overrides using #include "...", while the overrides themselves can reference original Chromium files using #include <...>. Since Chromium uses #include "..." for all in-tree files, we can leverage this convention and configure our overrides so that we can drop support for #include "src/" later by removing -I../../.. and making rbe_exec_root modification obsolete (the main goal).
This commit introduces a new quick action button that allows users to delete
downloaded files directly from the download bubble interface. The feature
provides a more convenient way to manage downloaded files without requiring
users to navigate to the file system or open another UI.
- Add BraveDownloadCommands class extending DownloadCommands with two Brave
commands:
- kRemoveFromList: Removes item from download list (file remains on disk)
- kDeleteLocalFile: Deletes file from disk and removes from list
- Implement command handling in DownloadBubbleUIController to process the new
delete actions
- Update DownloadItemModel to support the new delete functionality
- Add UI integration in DownloadBubbleRowView to display the delete quick action
- Add comprehensive unit tests for the new functionality
- The delete quick action is conditionally shown based on download state
<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/35432
This override was doing a copy of the value passed in, `cookie_info`,
and then changing the value of one of the fields to `kHide`, in order to
make things work properly for the rest of the things done by the
override, and avoid a `CHECK`. The issue here is that `cookie_info` is a
`const` reference, and `cookie_info` have a copy constructor, so the
fields were being copied manually. This worked for a short time, until
other fields were added to this struct, with some being uninitialised.
This change removes the whole copying of this type, as that is
bug-prone, with new fields being added, and rather overrides
`SetThirdPartyCookiesInfo` to always bail out, as this is the actual
effect we are looking for by mutating the value of `cookie_info`.
`SetThirdPartyCookiesInfo` is only used by `SetCookieInfo` in fact.
Resolves https://github.com/brave/brave-browser/issues/47875
It is first stage of the PSST feature implementation. The main goal
was to make the existing code ready to the next implementation
steps and be consistent with feature requirements.
Resolves: https://github.com/brave/brave-browser/issues/46045
---------
Signed-off-by: Vadym Struts <vstruts@brave.com>
`npm run build -- Release --target=chrome/updater` gave:
ninja: error: '../../brave/app/theme/chromium/mac/app.icns', needed by
'phony/chrome/updater/mac/updater_app_icon', missing and no known rule
to make it
Resolvesbrave/brave-browser#47856
No functional changes.
As upstream makes ContentsContainerView handle border, we also should follow in that way.
BraveContentsContainerView will update border/radius.
So, we don't need to change MultiContentsView::Layout() because we updated it to apply custom border/radius.
It's BraveContentsContainerView's job.
Existing test can cover this changes. - SideBySideEnabledBrowserTest.BraveMultiContentsViewTest
* Move overrides of default pref values to a function.
* Disables aimode keyword search via policy.
* Disables aimode in settings and omnibox.
* Disables failing upstream unit test.
Reland Notes: This PR was reverted because
`SidePanelUtil::PopulateGlobalEntries` was CHECKing for the coordinator
pointer, however we do not create the coordinator for popups or desktop
PWAs. This reland corrects that, adds test to cover that case, and also
guard the creation of the coordinator behind the playlist feature flag.
This PR converts `PlaylistSidePanelCoordinator` to a browser window
feature. This means abandoning the use of `BrowserUserData` for it,
and applying the principle outlined for these types of components in
https://chromium.googlesource.com/chromium/src/+/main/docs/chrome_browser_design_principles.md
Additionally, this change does away with PlaylistSidePanelWebView, as
it was merely a think layer over the base class, providing a WeakPtr
member. The base class itself, SidePanelWebUIView, has a weak ptr
factory that we could expose if we really need that type of semantics,
however for the use in this coordinator, it doesn't seem to be the case
that we need weak ptr semantics when there is in fact an observer for
the views life time, which can easily be used to reset the pointer to
the view.
Most Browser* layer violations have been correct, although there should
be a follow up to entirely remove Browser* and similar uses of
GetBrowserForMigrationOnly, by properly correcting the access to
BrowserView in other places.
Resolves https://github.com/brave/brave-browser/issues/47604
This header guard started failing recently. Maybe something changed
since M139, but it is not very clear what happened. This change corrects
the presubmit warning with the expected value.