28 Commits
Author SHA1 Message Date
Sangwoo Ko 263959fa7f [Containers] Show PageActionView for partitioned storage tab in location bar (#34248)
* Show PageActionView for partitioned storage tab in location bar

When the current tab uses a Brave container (partitioned storage), show the
page action in the location bar with the container's icon, name, and
background color from ContainerModel.

- Register kPartitionedStorageActionIconType and enable it in the location
    bar only when ENABLE_CONTAINERS and the Containers feature are on.
- Add PartitionedStoragePageActionController that resolves the tab's
    container via GetContainerIdForWebContents and ContainerModel, and drives
    the generic PageActionView (Show/Hide, OverrideImage/Text, etc.); the
    action is hidden when the tab has no container.
2026-03-04 06:49:08 +09:00
cdesouza-chromium 546903972c [CodeHealth] Use base::DictValue/base::ListValue - Part IX (#33700)
These classes were hoisted and renamed. This has been replaced in
Chromium as well. This is a mechanical change for Brave, done with the
following script.

```
git grep -lw 'Value::List' | xargs sed -i 's/\bValue::List\b/ListValue/g'
git grep -lw 'Value::Dict' | xargs sed -i 's/\bValue::Dict\b/DictValue/g'
git cl format
```

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6bc468d481835992696083e99e556516fb7f5f80

```
commit 6bc468d481835992696083e99e556516fb7f5f80
Author: Avi Drissman <avi@chromium.org>
Date:   Thu Jan 29 22:14:50 2026 -0800

    Remove aliases for base::DictValue and base::ListValue

    This removes a few last stragglers as well.

    Fixed: 478100525
    Cq-Include-Trybots: luci.chromium.try:win-official,mac-official,linux-official,android-official,android-desktop-x64-official
    Change-Id: If92142b8ab0562a82c609b71c6b2a7665cea6ec6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7513889
    Auto-Submit: Avi Drissman <avi@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1577038}
```

Issue: https://github.com/brave/brave-browser/issues/52435
2026-02-05 16:40:22 -03:00
Claudio DeSouza c164d6759c [cr145] IWYU for callback_helpers.h
This change does IWYU additions for all cases where `base::DoNothing` is
used. Furthermore, this change removes some of the uses of
`base::DoNothing` as an argument default value in a header, removing the
need to add `callback_helpers.h` to those headers.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/e8436cccafc34d6e4d9c060f682345060579d208
https://chromium.googlesource.com/chromium/src/+/227f058d9b9e27370a64b34046d71b9f23106409

commit e8436cccafc34d6e4d9c060f682345060579d208
Author: Lei Zhang <thestig@chromium.org>
Date:   Fri Dec 12 15:16:22 2025 -0800

    Forward declare base::ScopedClosureRunner in some Blink headers

    Avoid including base/functional/callback_helpers.h when not needed. Also
    use base/functional/callback_forward.h since callback_helpers.h was
    providing callback.h. For scrollable_area.h, make this possible by
    getting rid the default arguments to PerformSnapping(),
    SnapAtCurrentPosition(), and SnapForEndPosition(). These methods have
    very few callers, so just pass in all the arguments. Then do IWYU to fix
    the build.

    Change-Id: I5cfd017bd6f392b0d97e99c41d4885fac7140a4c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7254408
    Commit-Queue: Philip Rogers <pdr@chromium.org>
    Auto-Submit: Lei Zhang <thestig@chromium.org>
    Reviewed-by: Philip Rogers <pdr@chromium.org>
    Reviewed-by: Christoph Schwering <schwering@google.com>
    Reviewed-by: Robert Flack <flackr@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1558318}

commit 227f058d9b9e27370a64b34046d71b9f23106409
Author: Lei Zhang <thestig@chromium.org>
Date:   Thu Dec 11 21:30:12 2025 -0800

    Do IWYU for callback_helpers.h in async_dom_storage_database.cc

    Add callback_helpers.h for base::DoNothing() usage. The transitive
    include that makes this work as-is will be deleted in the near future.

    Change-Id: Id5ba6db705434734a854874923b7bb196392ca6c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7253640
    Commit-Queue: Mingyu Lei <leimy@chromium.org>
    Auto-Submit: Lei Zhang <thestig@chromium.org>
    Reviewed-by: Mingyu Lei <leimy@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1557849}
2026-01-29 13:40:34 -05:00
Claudio DeSouza 13a2651e70 [cr143] GURL::*_piece() removed
All the main methods now return a string_piece, which made the `_piece`
functions redundant.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/566074ac1aee3a91cbec0d2eac3120b7dd71860b

commit 566074ac1aee3a91cbec0d2eac3120b7dd71860b
Author: Charlie Harrison <csharrison@chromium.org>
Date:   Mon Oct 6 19:18:05 2025 -0700

    Remove GURL::*_piece() method

    There are no more users of this deprecated and misnamed API.
    This completes phase 1.5 of crbug.com/448174617.

    Bug: 448174617
    Change-Id: I82918ec4ec10b68729c31cb36487c7cb02ad0b56
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7008912
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Owners-Override: Charlie Harrison <csharrison@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1525986}
2025-11-18 11:18:46 -05:00
AlexeyBarabash 2150bb0228 [cr142][Android] New arg GestureDeviceType at GestureEventAndroid.ctor
Chromium issue:
https://source.chromium.org/chromium/chromium/src/+/d901835570a1fdc00796ba3a4403d70edd8e96cc

	Add GestureDeviceType to GestureEventAndroid

	GestureEventAndroid currently has no information on its source device.
	However, its only usage is to eventually be converted to a
	WebGestureEvent in blink CreateWebGestureEventFromGestureEventAndroid,
	where the WebGestureEvent's source is hardcoded to touchscreen.

	Add the field to GestureEventAndroid so we could specify touchpad as
	source in the next commit for touchpad flings.
	For now all constructor callsites pass touchscreen as source so this
	change is effectively no-op.

	Bug: 441635906
	Test: manual: touchscreen and touchpad pinch, scroll, fling work
	Change-Id: I8fad39d0df46e6d654bda86d2a25dce22cfde0b5
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6938528
2025-10-15 18:32:08 -04:00
Brian Johnson 7989acf16f [Speedreader] Cleanup pref/feature/method naming (#31415)
Rename pref/features to try to make them more clear. `Enable` means that the site will open in Speedreader automatically. `Allow` means it may open in Speedreader depending on whether it's a site specific override or allow for all readable urls is true and the url looks readable.
2025-09-30 08:07:18 -07:00
Brian Johnson 1f27a328c6 [Speedreader] Remove speedreader on android (#31418)
Remove buggy speedreader implementation on android
2025-09-29 11:52:46 +09:00
Brian Johnson dd71fdad9c [CodeHealth][Speedreader] use dependency injection for speedreader service in tab helper (#31414)
Pass SpeedreaderService to the tab helper constructor
2025-09-28 17:59:19 -07:00
Brian Johnson ed94a24fea [speedreader] BRAVE_SPEEDREADER content settings default value (#31409)
Change BRAVE_SPEEDREADER default from CONTENT_SETTINGS_DEFAULT to CONTENT_SETTINGS_ASK
2025-09-24 16:45:15 -07:00
Claudio DeSouza 0ef6dad0df [cr141] IWYU fixes 2025-09-22 14:59:27 -04:00
Pavel Beloborodov 644dfbecbf Speedreader GN structure. (#30702)
* Inroduced BUILD.gn for //brave/browser/speedreader.
2025-09-01 20:10:34 +07:00
Pavel Beloborodov 33e16ff315 New speedreader tune dialog (#19715)
* New speedreader tune dialog
2023-08-29 20:57:06 +07:00
Mario Sanchez Prada 7d7f5e7554 Added missing includes for build/build_config.h 2022-03-22 10:57:30 +01:00
Mario Sanchez Prada f4c7bdda37 Migrate define(OS_*) to using BUILDFLAG(IS_*) instead
See the following PSA in the chromium-dev mailing list for more
information and links to the original discussion, the design
document and the metabug:

https://groups.google.com/a/chromium.org/g/chromium-dev/c/EIuQCy9sVfw/m/Net3FPz6AwAJ

Resolves https://github.com/brave/brave-browser/issues/21608
2022-03-22 10:57:30 +01:00
Ralph Giles 2a4843ee51 Speedreader: Fix test conditional disable style.
Match upstream style for disabling tests on specific platforms.

Addresses review comment from @goodov.
2022-01-03 12:34:37 -08:00
Ralph Giles 3900f09457 Speedreader: Disable flaky ui browser test on macOS.
SpeedreaderBubbleBrowserTest.InvokeUi_speedreader_mode_bubble_basic
has been intermittently crashing in CI. Work around the issue by
disabling the test on macOS so we don't interfere with tests passing
but still get some test coverage, until the root cause can be addressed.

Issue brave/brave-browser#20082
2021-12-17 12:13:52 -08:00
Ralph Giles 070670fe92 Speedreader: Assert successful navigation in ui browser test.
Call `EXPECT_TRUE` to check the return value of `WaitForLoadStop`
per usage comment on the declaration. This will give better
error logging if this step is failing.
2021-12-17 12:11:20 -08:00
mkarolin 3f06461c6d ui_test_utils::NavigateToURL is now WARN_UNUSED_RESULT
Chromium change:

https://chromium.googlesource.com/chromium/src/+/fb432b1ad18bc0654844e147bf089237e97b6cd3

commit fb432b1ad18bc0654844e147bf089237e97b6cd3
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Wed Sep 8 22:16:13 2021 +0000

    Mark ui_test_utils::NavigateToURL as WARN_UNUSED_RESULT.

    This is step 2 from https://crbug.com/1246568 - it adds
    WARN_UNUSED_RESULT annotation to ui_test_utils::NavigateToURL to ensure
    the callers verify if the navigation has succeeded.

    The CL has to add ASSERT_TRUE in a few places that have already started
    backsliding since https://crrev.com/c/3140783 and
    https://crrev.com/c/3149434.

    Bug: 1246568
2021-10-05 16:21:41 -04:00
Kevin Kuehler cc8cbcbcee Fix Speedreader Bubble test
Remove the dependency on the Speedreader service. It's been failing due
to assumptions about whether the test starts with it enabled or
disabled. It has nothing to do with the bubble being shown or not.

Resolves https://github.com/brave/brave-browser/issues/17765
2021-08-30 12:25:41 -07:00
Kevin Kuehler a65ec85aca speedreader: Fix InvokeUi test on bubble
Use the service and not the tab helper. This is due to inconsistent
behavior with the webcontents in the test.

Resolves https://github.com/brave/brave-browser/issues/16903
2021-07-12 11:54:00 -07:00
Kevin Kuehler cb2df2e5d1 speedreader: PR fixups
* Remove unnecessary deps
  * Delete old commented out code
  * Fix typo in generated resources
  * Make naming more clear
2021-06-25 14:10:51 -07:00
Kevin Kuehler c0d9e84cf4 speedreader/tab_helper: Remove static Get method
Requested by @bridiver

Resolves https://github.com/brave/brave-browser/issues/16292
2021-06-09 09:47:33 -07:00
Kevin Kuehler a4ae38137b speedreader: ui: Rename the bubbles
* Rename `SpeedreaderBubbleGlobal` to `SpeedreaderModeBubble`. Global
    can be confused with global variables. This bubble is only shown
    when Speedreader is enabled.

  * Rename `SpeedreaderBubbleSinglePage` to `ReaderModeBubble` since
    the design spec explicitly calls this state reader mode.
2021-06-03 11:35:42 -07:00
Kevin Kuehler 3371956f88 speedreader: ui: janitorial cleanups 2021-06-01 21:04:27 -07:00
Kevin Kuehler 81b200a4ef speedreader: ui: gn check fixes 2021-06-01 15:03:13 -07:00
Kevin Kuehler 27402a9009 speedreader: Merge tab helper and bubblecontroller 2021-06-01 13:24:40 -07:00
Kevin Kuehler 1ece64cbc8 ui: Fix layer violation in SpeedreaderBubbleView 2021-06-01 13:05:50 -07:00
Kevin Kuehler 293ff5a8f8 speedreader: ui: Implement location bar bubbles
There are two bubble classes implemented in this PR:
`SpeedreaderBubbleSinglePage` and `SpeedreaderBubbleGlobal`. The former is
when Speedreader is not enabled. The UI prompts the user to enable
Speedreader. The latter is when Speedreader is enabled and shows the
current domain that is distilled, giving the user the option to
blacklist just that domain.

Both the classes share an interface in `SpeedreaderBubbleView`, which is
managed by the `SpeedreaderBubbleController` singleton.

To make the review process easier, the actual logic in both views is
stubbed out, and all the code is unreachable outside of tests. The
reason for this is because it will require changes to the Speedreader
service and the settings page, making this to hard to review on its own.

Resolves https://github.com/brave/brave-browser/issues/16162
2021-06-01 13:05:49 -07:00