The following content consists of the original commits. Original HEAD
commit is b599de1bcf0702ca11466a3ae1afeac732839544
* shields: add unified panel UI resources and skeleton handler
Add the new unified Shields panel that replaces the legacy popup,
triggered from the existing toolbar Shields icon.
- BraveUnifiedPanelHandler.java (new): skeleton handler with
popup display, basic shields status rendering, favicon display,
and lifecycle management.
- BraveShieldsHandler.java:
- Add mBlockedUrls tracking to BlockersInfo.
- Add getTotalBlockedCount() and getBlockedUrls() accessors for
the unified panel.
- BraveShieldsContentSettings.java:
- Add resetSiteToDefaults() to reset all per-site shields
settings to global defaults via individual JNI getter/setter
pairs.
- BraveToolbarLayoutImpl.java:
- Instantiate BraveUnifiedPanelHandler and route Shields button
taps through it instead of the legacy handler.
- All XML drawables, layouts, string resources, colors, styles,
and BUILD.gn/brave_java_sources.gni wiring.
* shields: implement advanced options and toggle controls
Wire up the expandable advanced options section and all toggle
controls in the unified Shields panel.
- BraveUnifiedPanelHandler.java:
- Implement shields on/off toggle with observer notification.
- Add block scripts and fingerprinting toggles with
BraveShieldsContentSettings persistence.
- Add advanced options expand/collapse with navigation items.
- Add reset site shields to defaults.
- Stub methods for sub-panel navigation.
- BraveToolbarLayoutImpl.java:
- Extract BraveShieldsMenuObserver into a shared instance and
register it on both the legacy and unified panel handlers so
either can trigger toolbar icon updates and page reloads.
* shields: add sub-panel navigation for detailed settings
Implement the drill-down sub-panels accessible from the advanced
options section of the unified Shields panel.
- BraveUnifiedPanelHandler.java:
- Fill out stub navigation methods with full implementations.
- HTTPS upgrades panel with strict/standard/disabled radio
options.
- Trackers & ads panel with aggressive/standard/allow settings.
- Cookies panel with block-all/block-third-party/allow settings.
- Shred site data panel with auto-shred mode selection dialog
and immediate shred with confirmation.
- Each sub-panel persists its selection via
BraveShieldsContentSettings and provides return navigation
to the main panel.
* shields: display favicons for blocked trackers and ads
Add favicon display for blocked tracker domains in the unified
Shields panel, showing up to three cascaded icons with a
prohibited overlay.
- BraveUnifiedPanelHandler.java:
- Add asynchronous favicon lookup via
FaviconHelper.getLocalFaviconImageForURL with a multi-step
fallback chain: exact origin -> registrable domain (via
UrlUtilities.getDomainAndRegistry) -> alternative TLDs.
- Prioritize successfully loaded favicons before
letter-placeholder defaults.
- Render circular icon containers with theme-aware backgrounds,
negative-margin cascading, z-ordering, and a stroke-based
prohibited overlay.
- Use UrlFormatter for display-friendly domain names.
- Use ViewUtils.dpToPx for density-independent measurements.
* shields: implement broken site reporting panel
Wire up the broken site reporting panel in the unified Shields UI,
accessible when shields are toggled off.
- BraveUnifiedPanelHandler.java:
- Add showReportBrokenSitePanel() and
setupReportBrokenSitePanel().
- Display site favicon and domain via UrlFormatter.
- Populate category selection from WebcompatReporterHandler.
- Attach screenshot via BraveShieldsScreenshotUtil.
- Pre-populate contact info from existing reporter preferences.
- Add learn-more clickable span linking to community support.
- Submit report via WebcompatReporterHandler with toast
confirmation.
* shields: Add tests for suitable bits of the implementation.
Add unit tests for the new unified Shields panel logic introduced
across the preceding commits.
- BraveShieldsContentSettingsResetTest.java:
- Verify resetSiteToDefaults() reads global defaults and applies
them to a per-site URL for all eight setting types.
- Verify HTTPS upgrade setter is skipped when global default is
"default" and called when it is any other value.
- BraveUnifiedPanelHandlerStatTest.java:
- Verify addStat() increments the correct counter for each block
type (ads, trackers, scripts, fingerprinting).
- Verify blocked URL recording with 50-item cap.
- Verify clearBraveShieldsCount() resets and removeStat() deletes
tab entries.
- Verify getters return sensible defaults for unknown tab IDs.
- Verify per-tab stat isolation.
- BraveUnifiedPanelFaviconPriorityTest.java:
- Verify populateBlockedItemsContainer() prioritises successfully
loaded favicons before letter-placeholder defaults.
- Verify display is capped at MAX_BLOCKED_ICONS (3).
- Verify onFaviconResult() countdown triggers population only
after all loads complete.
- Verify cascading negative-margin layout for overlapping icons.
- BUILD.gn (brave/android/junit, brave/test):
- Register new robolectric_library targets for the shields and
preferences.website test packages.
* Cleanup & Remove old Shields UI.
This commit completes the changeset by removing the old Shields UI from
the codebase.
Since only a small amount of functionality needed to be kept from the
old UI's code, it has been relocated into BraveUnifiedPanelHandler
* Apply Shields UI tweaks.
This commit applies a number of minor tweaks that were initially missed
from the Figma designs. This should make the look and feel match with
the intended UX fully.
* Shields: Task-post & Back button cleanup.
The back button has been moved to its own XML which is then included by
other dialogs. Additionally, the Shred UI has been fixed up to be
consistent with the existing dialogs.
The favicon rendering task uses PostTask now. The check for whether or
not to post the task has been removed since the callback checks it
anyway and the saving from not posting the task would require pretty
tight timing in order to actually be of benefit so it's arguably not
worth double-checking.
* Shields: Improve accessibility for toggle switches.
Since we have custom-designed toggles, TalkBack would consider them
images. We now attach a delegate to these controls that causes them to
be treated as switches.
* Shields: Improve title sizing, HTTPS reset & fix radio buttons
The title sizing now uses a standard Material style for titles along
with a few tweaks that make it dynamically downsize itself to avoid
truncation.
The HTTPS settings reset is now called unconditionally in order to
resolve a report from the puLL-Merge bot.
Finally, Since there appears to be no easy way to group the radio
buttons whilst retaining the desired style, the code now unconditionally
unchecks them after a settings reset to ensure multiple entries don't
appear to be selected.
* Shields: Remove tryAlternativeTldFavicon code.
We originally implemented a hack for verifying if favicons would load at
all. It has served its purpose and we of course can't legitimately
attempt to pull favicons for other TLDs since they could just be
flat-out wrong. There may be desire for a mechanism in future where we
alias domains, but that is largely out-of-scope for our UI.
* Shields: Support zooming/scrolling the screenshot preview.
When a user reports a site and previews the screenshot (if they choose
to send one) they can now zoom and scroll around the image.
This commit includes the implementation of a reusable class for handling
inputs and scaling the image. I didn't find any pre-existing code for
this behaviour and whilst it could be used elsewhere, I've left it
embedded as a static class since there are no other potential users at
this juncture.
* Shields: Restore code that handles WebView usage.
The old implementation of the Shields panel would ensure
`mHardwareButtonMenuAnchor`/`mContext` were initialised when in WebView
only mode. We still require this in order for the panel to still work.
* Implement more requested minor UI tweaks.
This adds animations to the toggle buttons in the new Shields UI and
fixes the ripple animation on the advanced expander which was missing a
single XML attribute that clamped the effect to the bounds of the
rounded box.
The blocked trackers (without a favicon) have also been tweaked to use
colours from Nala and the letter has been sized up to match the Figma
design.
* Switch toggles to Material UI
This commit switches the toggles to Material UI. This doesn't appear to
have any discernible issues but I'm keeping it separated just in case.
* Support Material You colours and tweak minor UI issues.
This commit alters the XML files so that Material You themes should work
out of the box once the Brave flag for dynamic colours is enabled.
Also resolves a few minor UI issues with placing/alignment/sizing.
* [Android] Show loading state in Origin preferences during post-purchase credential fetch
When a Brave Origin purchase is completed, there is a delay while the
receipt is passed from Play Store to the SKUs SDK via
fetchOrderCredentials. During this time, the Origin preferences screen
opens but credentials aren't ready yet.
- Disable all toggles and clickable preferences until
fetchOrderCredentials completes
- Show a snackbar with "Disabling features" spinner instead of
"Restart now" during the credential fetch
- On success, re-enable preferences and transition to "Restart now"
- On failure, close the preferences screen
- Always show restart snackbar on toggle change regardless of
setPolicyValue result, since failure means a restart is needed
- Remove duplicate color definitions (schemes_primary_fixed_dim,
schemes_on_primary_fixed, semantic_text_secondary,
semantic_text_tertiary) that already exist in nala tokens
Resolves: https://github.com/brave/brave-browser/issues/53915
Implements new layout for widget search promo panel and introduces better handling of activity recreations and configuration changes to redraw the widget search promo panel with correct theme (day/night) and proper position.
Other notable enhancements:
- Tweak tablet margins to better frame the onboarding cards on foldable devices after initial review with the design team.
- Fix post-FRE intent and delay activity to avoid a glitch on foldable devices by following the same strategy applied upstream.
- Accessibility: include content descriptions for widget search promo panel images.
- Nala: include new drawables from Nala tokens.
- Append new source android-widget for all searches made from the widget.
- Implement tests to verify new source android-widget.
Redesign the Origin preferences screen: add a custom restart
snackbar with dismiss button shown on toggle changes, split then
description into styled title/body/note sections, and rename
the bottom section from Subscription to Purchase.
Resolves: https://github.com/brave/brave-browser/issues/52774
Updates the Day Zero onboarding experience on smartphones and small screen devices to a multi‑step, horizontally advancing flow driven by CTA buttons.
It introduces distinct layouts per step, a pager animation helper, and updates onboarding logic to support a scalable, multi‑step sequence with minimal duplication.
Tablet support is intentionally out of scope and will be handled in a separate PR.
This change has been produced using a Ruby script that implements the
following logic:
1. For each <color> tag in the destination, try to find one in the
source with the same name
2. If found, update the destination tag with the colour from the source
tag
3. If not found, do nothing and move onto the next tag.
4. Tags that exist in the source but not the destination are ignored.
Currently, some tags exist in the destination XML that are missing from
the source and also vice versa.
Once this has been resolved, we should be able to delete the files in
this diff and move to simply copying the generated XML files straight
out of brave/leo.
Additionally, a small change has been made to the Brave Sync "Add New
Device" button to use a Nala-defined colour rather than being hard-coded
to white.
Closesbrave/brave-browser#49143
* [Android] Initial integration of quick shortcut button
- Adds flag for quick shortcut (disabled until all Brave items are available)
- Makes parity with options available with the upstream
- Visual and UI fixes
* Moves flag under Android guards
* Add support for diferent variants
* Remove omnibox highlight which shows up right after onboarding
* Add different variants function
* Add search widget promo on NTP
* Add notification permission changes
* Update widget promo UI
* Update wdp check
Resolve presubmit issue
Implements new layouts and new logic for recovery screens.
1. The recovery phrase is shown when a new Wallet is created and the UI is presented with a blurred component that will be unblurred only upon user confirmation.
2. The recovery phrase verification is now in three steps and will ask to confirm three words picked at a random position.
For security reasons these steps won't allow back navigation and skipping them will consider the backup process as not completed, so the user will have the option to complete the verification later on.
3. The new Wallet restoration screen is the most complex screen of this PR. It accepts a mnemonic phrase made by 12 or 24 words. It can be copied over from clipboard, spit, formatted and pasted nicely in each edit text. The edit text items have been customized to accept the pasted text (See `PasteEditText` component). The layout can switch from 12 and 24 words, and also has a button to mask and unmask the words. The continue button is responsive and is enabled ONLY when all the items have been filled.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8f9443470e9356596b45f0ca9ca929f680a71937
[Refactor] Move TabContentManager to chrome/browser/tab_ui.
In this CL, move the following classes to chrome/browser/tab_ui:
- ThumbnailProvider;
- TabContentManager;
- InvalidationAwareThumbnailProvider.
This continue to remove dependencies of chrome_java in
SingleTabSwitcherOnNtpMediator. This CL contains mechanical changes
only.
Bug: 330574966
* Refactor clear clipboard methods and add Javadocs
* Fix null pointer exception when the app is in background
* Remove redundant API check
* Remove unused interface methods
* Perform small refactoring to improve readability
* Remove unused tag
* Move animation drawable to parent class
* Implement custom style for input edit text component
* Implement biometric button
* Rename color using Nala naming convention
* Rename colors following Nala naming convention
* Add UI for always on feature
Add roboto flex font
* Add always on tutorial image resources with tab selectors
* Update UI chanegs for always on tutorial
* Add license headers for resources
Update text change with license header
* Perform minor improvements
* Add back and close icon to main layout
* Perform refactoring to OnNextPage interface
* Implement BaseWalletNextPageFragment that holds a reference to next page interface
* Refine Utils class
* Switch Wallet actions from int to enum type
* Move UnlockWalletFragment outside onboarding package
* Rename onboarding fragments
* Add Javadocs and code comments
* Update onboarding
Add exoplayer hls dependency
Add HLS support
Make changes for events
Refactor PlaylistOptionsEnum
Refactor logs
Remove unused imports
* Update playlist event behaviour
Remove unused imports after refactor
Address PR comments
* Add message for already added content in default playlist
* Add to playlist menu
Add to playlist prefrence
* Move first kotlin class for onboarding to brave core
Add whole kotlin module into brave core
Add required changes for custom datasource
* Add native worker changes for stream
Add initial work for bytes transfer
Changes to play from saved byte array
* Add HLS parsing
Update datasource
* Add playlist streaming mojom implementation
Add observer for playlist streaming
Add playlist streaming observer
Stream from downloading file
Remove test video activity
Remove custom datasource
Remove kotlin files
Initial work for partial download play
* Update soilution for downloading HLS content
* Add download service with progress notification
Add DownloadUtils functions for mp4
Add function for HLS downloading in DownloadUtils
Add changes for hls download in downloadutils
Update changes to file location for playlist item
Add download queue for HLS
Add hlsMediaPath field for android
Update hlsMediaPath after download
Update existing changes with hls file
add changes to donwload multiple HLS items
* Update changes to multiple downloads
Resolve rebase errors
Download progress update after rebase error resolution
Update streaming observer
Add new event callbacks in mojom
Update existing observer logic
* Migrate exoplayer deps with chromium
* Update UI changes to represent download state
Refactor to remove unused import and implementation
Remove auto save settings option
Update move/delete/share icons
Update filesize update
Hide cast button
Remove unused resources in kotlin module
Add patch to suppress lint for unstable api
Remove indirect deps
Remove unrelated code changes
Resolve presubmit errors
* Refactor HLS content generation
* Remove cast dependency
Refactor logs
* Update add media icons resource
Update player bottom sheet behaviour
Address PR comments
* Remove playlist warning dialog as it's irrelavent
Remove unnecessary flag check
* Add playlist stremaing class details
Reformat existing changes
Add mock data for hls file path
* Resolve rebase errors
Resolve presubmit checks
* Update player items on delete/reorder
* Allow delete while in progress
Made changes to delete while playing
* Add prefs to BravePreferencekeys
* Update string resources
Remove debug messages
Resolve presubmit error
Update server selection behaviour from menu
Update server selection menu item
Add country flag
Update country selection icon tint
Update behaviour for country selection
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ecebb05e61843b6b2b0f8dd1b66158c2a1c98583
SwitchMaterial to MaterialSwitch
Migrate the SwitchMaterial (GM2) into MaterialSwitch (GM3).
To mitigate the size increase for the MG3 switch, we are applying a 0.8 scale for the switch, while setting a bigger minHeight (60dp) in order to maintain the min touch garget size. This however brings the side effect of size could have a bigger height.
Another side effect of scaling is the text come with switch widget will be scaled too. This CL mitigate that by wrapping the switches in a linear layout and intercept the text being set in the resources.
With this migration, there are few gotchas this CL also addresses:
- Migrate the UI using SwitchCompat into MaterialSwitch to keep the consistent look
- Add the materialSwitchStyle to Base.Theme.BrowserUI to cooperate UIs that uses SwitchPreferenceCompat out side of SettingsActivity
- Add themes to render tests that does not apply the theme themselves, so the switches on the goldens has the correct scale applied.
Bug: 1248590
* Tweak primary text color and action bar background color
* Tweak chip selector colors
* Optimize text color attributes
* Network selector icon size
* Tweak Assets text view
* Apply new Wallet background color
* Tweak Wallet background color and toolbar background color
* Add divider lines below toolbar and above navigation bar
* Tweak bottom navigation view style and minor improvements
* Apply code formatting
* Remove duplicated style