Commit Graph
44006 Commits
Author SHA1 Message Date
Max Karolinskiy 1af18b4eee [Android] integerListToIntArray -> integerCollectionToIntArray.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/9ccf06ad6b9d9dbf887274f60665bba8af145e4c

commit 9ccf06ad6b9d9dbf887274f60665bba8af145e4c
Author: vikas.mundra <vikas.mundra@samsung.com>
Date:   Tue Aug 8 14:45:01 2023 +0000

    Change integerListToIntArray to handle Collection<Integer>.

    Bug: None
2023-09-06 12:38:51 +01:00
Max Karolinskiy 45bcb78064 [Android] Suggest components moved to appropriate packages.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/6e3695055282bde2999201b8c5a7629428831f2e

commit 6e3695055282bde2999201b8c5a7629428831f2e
Author: Tomasz Wiszkowski <ender@google.com>
Date:   Fri Aug 4 17:03:26 2023 +0000

    Move suggest components to appropriate packages.

    The change moves
    - SuggestionSpanable to styles package (away from `base`),
    - HistoryClustersProcessor to history_clusters package (ditto).

    The change bumps test coverage for both relocated classes to 100%.
2023-09-06 12:38:51 +01:00
mkarolin 7c77d1a3b1 Cleanup resource_ids.spec. 2023-09-06 12:38:51 +01:00
mkarolin c70040567d MenuItemView::HasIcons was removed.
Chromium change:

https://chromium.googlesource.com/chromium/src/+/0d0322b87e3fcfe9f0878f08b3887cd7b41ed3cf

commit 0d0322b87e3fcfe9f0878f08b3887cd7b41ed3cf
Author: Peter Kasting <pkasting@chromium.org>
Date:   Tue Aug 8 19:24:23 2023 +0000

    More consistent icon handling for menus.

    * Eliminate MenuItemView::set_has_icon(); make all menus consider icon
      state. This was a footgun.
    * For height consistency, menu items without icons would have a minimum
      height of the check height if any items had icons. This is now
      better-documented, applied even to items _with_ icons (in case
      their icons are small), and not applied to separators (which have
      their own min-height config values).
    * System menus on Windows were marked as owner-draw if they had icons,
      but we didn't do any custom owner drawing. Never owner-draw these.

    This then simplifies/cleans up as a result of the above.

    Bug: none
2023-09-06 12:38:51 +01:00
Max Karolinskiy 1007ebbc26 [Android] Presubmit: fixes naming conventions warnings. 2023-09-06 12:38:51 +01:00
Max Karolinskiy b1239a0d2c [Android] Presubmit: fixes if/for without {}. 2023-09-06 12:38:51 +01:00
Max Karolinskiy 693757862b [Android] Presumit: remove unused imports. 2023-09-06 12:38:51 +01:00
mkarolin ff3cd856f1 Removed no longer valid expectations from BlobUrlBrowserTest.ReplaceStateToAddAuthorityToBlob.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/16b5623e6ef896e7e9b57546cd97881310e991ec

commit 16b5623e6ef896e7e9b57546cd97881310e991ec
Author: Dominic Farolino <dom@chromium.org>
Date:   Tue Aug 1 12:26:10 2023 +0000

    Blink: Fix CanChangeToUrlForHistoryApi() to be spec-compliant

    The `blink::CanChangeToUrlForHistoryApi()` helper takes in a target URL
    and a document's current URL, and evaluates whether we can set the
    latter to the former for same-document navigations. The spec equivalent
    is HTML's "can have its URL rewritten" [1] algorithm.

    Before this CL, that function deviated from the spec in a number of
    ways:
      1. It created a SecurityOrigin out of the target URL and used it for
         same-origin checks with the document's actual origin. This is
         fraught for `about:blank/srcdoc` KURLs which don't carry their
         actual origin with them. So they're always seen as opaque, and
         `history.pushState()/replaceState()` was rejected for them. Per
         spec however, those APIs should work in those documents. This was
         discovered in https://crrev.com/c/4690242 and is fixed here.
      2. It has non-standard code that allows opaque origins to change their
         fragment. This isn't actually much of an issue, and it's documented
         that the behavior exists for compatibility reasons, but the issue
         is that at the same time, we *disallow* path mutations for URLs
         in opaque origins, even though HTML allows these modifications for
         all HTTP(S) URLs, per step (2) of the spec algorithm [1].

         This CL implements this step correctly and changes the
         corresponding security web test expectations to expect a
         path-mutating `history.pushState()` to succeed on an HTTP(S) site
         running in an opaque origin.
      3. It deferred to `EqualIgnoringPathQueryAndFragment()` for all other
         URLs, while the HTML Standard explicitly disallows path mutations
         per step (4) in the spec algorithm [1].
           a. This had the positive side-effect of allowing path mutations
              for "standard" URLs — like `chrome://`, `chrome-extension://`,
              and `chrome-error://` — that are registered specially with
              `url::AddStandardScheme()`. Chrome WebUI and extensions seem
              to rely on this behavior, and that's fine since it's a
              non-standard allowance.
           b. The negative side-effect of (a) above is that we allowed path
              mutations for even non-specially-registered URLs, like `blob:`
              URLs. For example, before this CL, Blink allowed changing
              `blob:https://example.com/{UUID-HERE}` to
              `blob:https://spoof.com@example.com/abcd`, which is
              same-origin, so the code permitted it, but it was a path
              change, which is illegal per spec. What's more is that this is
              considered a UI URL spoof, and if you did this the browser
              would change the URL bar to `about:blank#blocked` but the
              document's URL would still be updated to the spoofed URL in
              Blink; this led to really weird test expectations [2]. This
              CL fixes the behavior and those test expectations

    After this CL and the fixes mentioned above, there are still two
    outstanding non-standard conditions that this algorithm maintains:
      1. Allowing non-HTTP(s) opaque documents to mutate their query and
         fragment, for historical compatibility concerns that are documented
         in the code.
      2. Allowing "standard"-scheme URLs — which includes `filesystem:` and
         ones registered specially by //content embedders, like
         `chrome:`, `chrome-extension`, etc. — to change their path, query,
         and fragment, which is a much looser policy than we apply to other
         URLs.

    Additionally, before this CL, because we didn't even allow `pushState()`
    to be called on `about:blank` documents at all, we never had to
    implement step 4 of
    https://html.spec.whatwg.org/C/#url-and-history-update-steps, which
    ensures that `pushState()` on `about:blank` documents are done with the
    "replace" navigation mode. Now that this CL enables this to be hit, we
    must implement that step to be spec compliant. Without it, tests like
    `iframe-src-204-pushState-replaceState.html` would fail.

    [1]: https://html.spec.whatwg.org/#can-have-its-url-rewritten
    [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/blob_storage/blob_url_browsertest.cc;l=173-177;drc=cb17f93f3a17a6831cf90d616e23840f2ca726a5

    Bug: 1239052,1465972
2023-09-06 12:38:50 +01:00
Claudio DeSouza 4a5a1528d4 [ios] Add chrome material branding provider
`SnackbarCoordinator` requires this new provider to be part of the ios
build, which this change caters to.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/d970dd3ab03b853c682a7d3454e6957a4f026a28

commit d970dd3ab03b853c682a7d3454e6957a4f026a28
Author: Gauthier Ambard <gambard@chromium.org>
Date:   Wed Aug 2 09:48:44 2023 +0000

    [iOS] Create provider for Snackbar branding API

    The provider will be used to add branding to the snackbar.
    This CL also properly use the Material API as it was designed to be
    used.

    Bug: 1468553
2023-09-06 12:38:50 +01:00
Claudio DeSouza fa633f8282 Fix HistoryAddPageArgs missing argument
`HistoryAddPageArgs` has a new argument `local_navigation_id`, that is
irrelevant to us. This change passes a nullopt for it.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/b9aeae59d6ce754afec8e39e8c36c3520f70c1a1

commit b9aeae59d6ce754afec8e39e8c36c3520f70c1a1
Author: Sana Akbani <sanaakbani@google.com>
Date:   Tue Aug 8 17:07:54 2023 +0000

    Add navigation id to History Service NotifyURLVisited param to be passed to observers

    Bug: b/1324053, b/1321222
2023-09-06 12:38:50 +01:00
Claudio DeSouza 425ced4449 Suppress C-type warnings on skus callbacks
A pragma has been added to the callbacks where a C-type desciption lint
would warn against using rust types on the API surface. These APIs are
eventually digested by cxxbridge, and therefore they are supposed to
have those types listed there.

The lint was updated recently in chromium upstream

Chromium change:
https://chromium.googlesource.com/chromium/src/+/e1f8ceaed890ed30131cca2402b30e073b452b20

commit e1f8ceaed890ed30131cca2402b30e073b452b20
Author: Alan Zhao <ayzhao@google.com>
Date:   Sat Aug 5 02:10:11 2023 +0000

    Roll clang+rust llvmorg-17-init-16420-g0c545a44-5 : llvmorg-18-init-1174-g2532b68f-1 / 006a26c0b546abc0fbef59a773639582b641e500-11 : 34ccd0485966c3933288cd30a076bef63e3298c5-1

    This also bumps the LLVM major version from 17 to 18.

    https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/0c545a44..2532b68f

    https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/006a26c0b546..34ccd0485966

    bootstrap/dist.rs changes: https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/006a26c0b546..34ccd0485966/src/bootstrap/dist.rs
    Changes to the `cargo vendor` step need to be reflected in
    `CargoVendor() in //tools/rust/build_rust.py and in
    `gnrt gen --for-std` in //tools/crates/gnrt/gen.rs.

    Ran: ./tools/clang/scripts/upload_revision.py 2532b68f684c25d98d6b25be2814bef0fd164332

    Bug: 1467585,1462432
2023-09-06 12:38:50 +01:00
Claudio DeSouza ed5d042f3f Adjusting Profile passing around HTTP first mode classes
Both `HttpsFirstModeService`, and `HttpsUpgradesNavigationThrottle` have
had changes around profile passing, with the former removing a redundant
passing, and the latter requiring it now.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/9ffdd328d00b07d618ae00b75585faaf727918ba

commit 9ffdd328d00b07d618ae00b75585faaf727918ba
Author: Mustafa Emre Acer <meacer@chromium.org>
Date:   Mon Aug 7 22:49:43 2023 +0000

    HTTPS-First Mode: Implement Typically Secure User heuristic

    This CL implements a new heuristic to automatically enable
    HTTPS-First Mode called Typically Secure User. In this heuristic, we
    check if the user is visiting mainly HTTPS sites after HTTPS-Upgrades
    is enabled by default. If the user visits a site that doesn't support
    HTTPS, HTTPS-Upgrades feature will fall back to HTTP and we'll record
    a persistent entry for this fallback event. If the user has a small
    number of fallback events recorded over a one week window (along with
    other checks such as old enough profile age), we'll automatically
    enable HTTPS-First Mode toggle in the UI.

    Bug: 1469343
2023-09-06 12:38:50 +01:00
Claudio DeSouza 52300374b1 IDC_RUN_SCREEN_AI_VISUAL_ANNOTATIONS renamed
This seems to be a simple renaming, that only affects a single test we
have.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/3209ab21b0b6cfd80f4e93d4028172fd70240107

commit 3209ab21b0b6cfd80f4e93d4028172fd70240107
Author: Kyungjun Lee <kyungjunlee@google.com>
Date:   Mon Aug 7 23:07:34 2023 +0000

    [Layout Extraction] Add an entry to the context menu and rename the IDC

    Add a menu entry to the context menu for Layout Extraction, which is
    behind a feature flag, for facilitating prototyping. Also, rename the
    existing IDC and function to be specific to the feature.

    AX-Relnotes: n/a.
    Bug: 1443349
2023-09-06 12:38:50 +01:00
Claudio DeSouza fa52dc7518 QUIC agent farbling override not needed
Upstream has removed `quic_user_agent_id` from `NetworkContext`,
possibly for similar reasons why Brave has been blanking the value. As a
result, the override in place for `ParseCommandLineAndFieldTrials` can
be deleted, as no user agent argument is being passed anymore.

commit 102ece5e619491fcedd7105852cd1afcda6898cc
Author: Kenichi Ishibashi <bashi@chromium.org>
Date:   Fri Aug 4 22:18:21 2023 +0000

    Remove quic_user_agent_id from NetworkContext

    Bug: 1448657
2023-09-06 12:38:50 +01:00
Claudio DeSouza 7ee16e931b Reachoring TabSearchButton overrides
Small changes upstream had moved the override, and had to be corrected.
Changes relating to CR2023 had changed the base class for this class,
which had broken the override.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/ac0fd87ed0942b80bfa209416b206f5a405033e5

commit ac0fd87ed0942b80bfa209416b206f5a405033e5
Author: David Pennington <dpenning@chromium.org>
Date:   Mon Jul 10 22:50:28 2023 +0000

    [ChromeRefresh2023] Refactor NTB and TSB into LabelButtons.

    LabelButton more correctly supports hover/pressed states that CR23
    tabstrip controls need to support.

    - Created a new class for NewTabButton to not break old functionality
      for non-CR23. (NewTabLabelButton)
    - Added support for hover states with InkDrop
    - Moved TabSearchButton to NewTabLabelButton (for both CR23 and GM2)

    Bug: 1462735, 1453679, 1457377, 1399942, 1462733, 1457286

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

commit a6253cc57b5b3fa6924245b7c8c5473088eab0a9
Author: Shibalik Mohapatra <shibalik@chromium.org>
Date:   Wed Aug 2 22:20:16 2023 +0000

    [Refresh] Update the background color for new tab button and tab search button.

    The background color for new tab button should be the same as inactive tab. This will look transparent for most CWS themes and but will also look good for third party themes like in the bug.

    This also fixes a regression for the tab search button not being painted without the chrome refresh flag.

    Bug: 1442904
2023-09-06 12:38:50 +01:00
Claudio DeSouza 6c91eac572 Fix access to AutofillClient instance
Upstream has changed `AutofillManager::client()` to return a reference,
which broke some of our code referencing it, and this change corrects
that.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/8ad051ffd3bda5a6c7faa416a1566ed721822a43

commit 8ad051ffd3bda5a6c7faa416a1566ed721822a43
Author: Christoph Schwering <schwering@google.com>
Date:   Wed Jul 26 16:30:19 2023 +0000

    [Autofill] Use raw_ref in AutofillManager, AutofillExternalDelegate

    This CL turns the following raw_ptrs into raw_refs:
    - AutofillManager::driver_,
    - AutofillManager::driver_,
    - AutofillExternalDelegate::manager_
    and also changes the return types of the corresponding getters from
    pointers to references.

    This CL has no side effects.

    Only tests used to pass nullptr. They don't do that anymore since
    they use injectors to inject the proper AutofillClient, AutofillDriver,
    AutofillManager.

    Bug: 1119526, 1007974
2023-09-06 12:38:50 +01:00
Artem Samoilenko a0ad3c094b [Android] [Empty States] Add tablet illustration to recent tab
Chromium change:
https://github.com/brave/chromium/commit/6c891621562a604a4081d2279ab182297d68e4f1

[Empty States] Add tablet illustration to recent tab
Tablet: https://screenshot.googleplex.com/3irSZPrQihe4Aes
Phone: https://screenshot.googleplex.com/5uYdnTStBGA6Xre

Bug: 1468426
2023-09-06 12:38:50 +01:00
mkarolin 4993144a5a Turns on upstream blink::features::kUACHOverrideBlank flag.
This would preserve our current behavior of empty UA metadata when the
UA is supplied on the command line.

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/0423ca8f56fe1b30a894e3873afc235e68f78701

commit 0423ca8f56fe1b30a894e3873afc235e68f78701
Author: Victor Tan <victortan@chromium.org>
Date:   Fri Jul 28 22:07:08 2023 +0000

    Generate low-entropy UA client hints if overrides UA in command-line

    This cl changes the behavior of generating user-agent client hints when
    user overrides user-agent in the command-line.

    We only send blank user-agent metadata if kUACHOverrideBlank feature
    turns on, otherwise, sending the default user-agent metadata with
    low-entropy client hints.

    For user-agent overrides, sending the blank UserAgentMetadata could cause requests being blocked by web application firewall, also, without sending user-agent client hints could cause compat issues because some Google services were expecting the sec-ch-ua* headers present.

    If we provide options to override the low-entropy user-agent client hints from command-line, it could introduce heavy work to validate the inputs to avoid any unexpected failures, especially validate the brand-version list for client hints sec-ch-ua. Another option could be that we can only provide command-line override for sec-ch-ua-plaform and sec-ch-ua-mobile if users really needs to override user-agent metadata from command-line.

    Bug: 1452040
2023-09-06 12:38:50 +01:00
mkarolin b08e107e90 Fixes presubmit license headers warnings. 2023-09-06 12:38:50 +01:00
mkarolin aa89809c48 //third_party/checkstyle 8.15 -> 10.12.1
Chromium change:

https://chromium.googlesource.com/chromium/src/+/39326acff8e5f1

commit 39326acff8e5f1694d053d659e35f80f7e0228f7
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Wed Jul 5 14:22:49 2023 +0000

    Roll //third_party/checkstyle 8.15 -> 10.12.1

    This makes checkstyle understand newer Java syntax.

    Bug: 1462201
2023-09-06 12:38:50 +01:00
Artem Samoilenko 8f48dbdea7 [Android] Explicitly added action for Brave intents
Otherwise there is lint issue:
Warning: This intent has no action set and is not explicit by component.You should either make this intent explicit by component or set an action matching the targeted intent filter. [IntentWithNullActionLaunch]
2023-09-06 12:38:50 +01:00
Claudio DeSouza d4b1d50d20 Add PDF details to InstallConstants instances
Upstream has rearranged a few fields in `InstallConstants`, to look more
natural with the addition of PDF information. This change adjusts our
instantiations of `InstallConstants` to line up with what is being done
in upstream.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6886a70cf0c4689bc827622846edfd9fac9eead8

commit 6886a70cf0c4689bc827622846edfd9fac9eead8
Author: David Bienvenu <davidbienvenu@chromium.org>
Date:   Wed Jul 26 15:52:05 2023 +0000

    win: Add support for PDF Prog Id

    No functional change. This CL adds support for PDF Prog Ids to
    InstallMode, and refactors the code a bit to distinguish between
    browser and PDF prog ids.

    Bug: 414141
2023-09-06 12:38:49 +01:00
Claudio DeSouza 506dc6ba4e Fixing SidePanel substitutions in SidePanelCoordinator
Chromium change:
https://chromium.googlesource.com/chromium/src/+/5f15f4ba1b8fa34aef8e11214d940d78e4c8e0f2

commit 5f15f4ba1b8fa34aef8e11214d940d78e4c8e0f2
Author: Zoraiz Naeem <zoraiznaeem@chromium.org>
Date:   Wed Aug 2 18:35:25 2023 +0000

    Ensure SidePanelCoordinator handles when SidePanel is deleted

    When browser view is being deconstructed, SidePanel is deleted first
    and SidePanelCoordinator follows it.

    This CL handles the cases where a client requests an action(Show,
    Toggle, etc) to SidePanelCoordinator after the SidePanel is deleted.
2023-09-06 12:38:49 +01:00
Claudio DeSouza 4d7e79a20a Revert "Corrrect to vector<raw_ptr<T>> upstream use"
This reverts commit f6b983af270ea589406d075ff9c294d46ab6d43c.
2023-09-06 12:38:49 +01:00
Claudio DeSouza e8c585137f [v8] Object methods now static
Codegen in v8 has been changing methods from member function to static
ones. This change corrects one such case in brave's codebase.

Chromium change:
https://chromium.googlesource.com/v8/v8/+/80eabe98c13771cd111c341cadd04ae6ec5d0239

commit 80eabe98c13771cd111c341cadd04ae6ec5d0239
Author: Liu Yu <liuyu@loongson.cn>
Date:   Wed Aug 2 16:34:04 2023 +0800

    [loong64][mips64][tagged-ptr] Make Object methods static

    Port commit f20f342a3e275ae6442a53e34869f1c90f0db4a0

    Bug: v8:12710
2023-09-06 12:38:49 +01:00
Claudio DeSouza ef325fe1c9 Add kDownloadBlockedLearnMoreURL definition
This URL is a fork of `kDownloadScanningLearnMoreURL`, which upstream is
breaking apart to allow for a future URL. This should be of no
consequence for Brave at the moment.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/cf466482765cd6021c0b8d1b4cff543d4aaa2474

commit cf466482765cd6021c0b8d1b4cff543d4aaa2474
Author: Lily Chen <chlily@chromium.org>
Date:   Tue Aug 1 18:38:11 2023 +0000

    [ImprovedDownloadWarnings] Add learn more link for blocked downloads

    This adds a link to the help center page about why Chrome has blocked
    a download. The same link is added to dangerous and suspicious
    downloads.

    Screenshots/screencast:
    https://drive.google.com/drive/folders/1GJQD7O5OAiPjb50CSBgXw-t4F-0LbVn6

    Bug: 1465966
2023-09-06 12:38:49 +01:00
Claudio DeSouza 4f8003b0ba kHttpsFirstModeV2 deleted and made default
This flag was being enabled in brave, and since the code guarded by it
has been made the only behaviour by upstream, it is safe to remove
references to it in our codebase.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/7a092ab29461a6864bf919ada619414b01d9f98d

commit 7a092ab29461a6864bf919ada619414b01d9f98d
Author: Chris Thompson <cthomp@chromium.org>
Date:   Tue Aug 1 16:36:40 2023 +0000

    Cleanup HFMv1 code and remove HFMv2 feature flag

    Bug: 1468577
2023-09-06 12:38:49 +01:00
Claudio DeSouza 5efd7d631f [ios] Add MiniMap provider
A new provider has to be added to our own list of providers, for the
linking to the ios app to work appropriately.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/11679c9d395f2b674ce5c29d75026b0fead13999

commit 11679c9d395f2b674ce5c29d75026b0fead13999
Author: Olivier Robin <olivierrobin@google.com>
Date:   Thu Jul 27 18:33:24 2023 +0000

    [IOS][OTMM] Create MiniMap provider

    This is part of a multi CL change that will add a consent screen for
    Mini Map.

    This CL adds the provider to be able to call Internal code af the
    interstitial is called.

    => crrev.com/c/4720968 : create mini_map provider
     - crrev.com/i/6215230 : implement mini_map provider
     - crrev.com/c/4725166 : use mini_map provider

    Bug: 1351353
2023-09-06 12:38:49 +01:00
Claudio DeSouza bdaa0828b5 Remove redundant ARC configs
Upstream has enabled ARC by default for apple code. This change removes
the individual setting of it across targets.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/8485b150e05e24548ec98413ced34994ab9ef622

commit 8485b150e05e24548ec98413ced34994ab9ef622
Author: Avi Drissman <avi@chromium.org>
Date:   Mon Jul 31 18:07:39 2023 +0000

    Rename "enable_arc2" to "enable_arc"

    Remove uses of "enable_arc" that snuck in, and rename "enable_arc2" to
    "enable_arc".

    Bug: 733237
2023-09-06 12:38:49 +01:00
Claudio DeSouza 59a051b65b Content Settings histogram values moved
Histogram values for Content Settings components include brave values.
These values are listed as part of a static flat map, and they have
recently been moved from a public header to a translation unit doing the
work with the representative value.

In this change we move the override and its implementation to the new
file.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/989b41b93018074f4647ab2352b7f051f1efd56a

commit 989b41b93018074f4647ab2352b7f051f1efd56a
Author: Florian Jacky <fjacky@chromium.org>
Date:   Mon Jul 31 16:33:42 2023 +0000

    Enforce metadata expiry actively

    Previously, metadata expiration was only checked on access (i.e. on content setting retrieval). This means that a site that continually used a stream returned from a camera/microphone request, would not have this access revoked. Thus the stream would not be terminated on expiry. For cam/mic this halts active streams, for geolocation this will halt active streams once crbug.com/1462313 is fixed. Additionally this CL reduces the expiry of one time permissions from 24 hours to 16 hours, to prevent interruptive behaviour when clients would still use the capabilities the next day without triggering any of the other one time grant expiration mechanisms.

    Bug: 1457179, 1459994
2023-09-06 12:38:49 +01:00
Claudio DeSouza 3db8fa0bbf QRCodeGenerator moved into its own namespace
This class was sitting on the global namespace before, but recent
changes upstream have placed it under `qr_code_generator`.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/b51d821ff0923aed5c072ec861b10641df930046

commit b51d821ff0923aed5c072ec861b10641df930046
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Wed Jul 26 16:32:57 2023 +0000

    Put `//components/qr_code_generator` into `qr_code_generator` namespace.

    This CL puts the C++ code under `//components/qr_code_generator` into
    the `qr_code_generator`.  This is motivated by the desire to:

    1. Follow the C++ style guide:
       https://google.github.io/styleguide/cppguide.html#Namespaces:
       "With few exceptions, place code in a namespace."

    2. Ensure that the C++/Rust FFI of QR code generator is a good role
       model for replicating in future C++/Rust projects.  In particular,
       this CL add the namespace to
       `#[cxx::bridge(namespace = "qr_code_generator")]`.

    To keep the scope of this CL small, we avoid changing:

    A. The `dino_image` namespace used by
       `//components/qr_code_generator/dino_image.h`.

    B. The `qrcode_generator` namespace used by
       `//chrome/services/qrcode_generator`.

    Bug: 1431991
2023-09-06 12:38:49 +01:00
Claudio DeSouza 38ae1aa1dd [ios] Fix AddPendingItem call during navigation
An extra argument has been added to `AddPendingItem`, which for now can
just be passed as false.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/1d5c4ff4841d405e63bc74dee07911051577c2af

commit 1d5c4ff4841d405e63bc74dee07911051577c2af
Author: Nohemi Fernandez <fernandex@chromium.org>
Date:   Fri Jul 28 18:18:08 2023 +0000

    [iOS] Fix issue that causes URL navigation reload to crash for interstitials.

    Adds an EarlGrey test for the supervised user interstitial use case where the crash was detected.

    Bug: b:291917831
2023-09-06 12:38:49 +01:00
Claudio DeSouza 1ccafdfbac HeapObject functions turned into free functions
Codegen around `HeapObject` used to insert dozens of functions as member
functions. This has recently been changed for the codegen to be free
functions, and this change corrects our code to reflect that.

Chromium change:
https://chromium.googlesource.com/v8/v8/+/9c869941764bc57a9a3b86a090323236d9b3af7c

commit 9c869941764bc57a9a3b86a090323236d9b3af7c
Author: Leszek Swirski <leszeks@chromium.org>
Date:   Fri Jul 28 17:21:46 2023 +0200

    [tagged-ptr] Change obj->IsFoo() to IsFoo(obj)

    Removes the IsFoo predicates from Object, HeapObject, and Tagged<T>, and
    replaces them with free functions that are passed a Tagged<T>.

    This allows a coding style which doesn't require "dereferencing" of
    Objects that could be Smis.

    Bug: v8:12710
2023-09-06 12:38:49 +01:00
Claudio DeSouza 03581949c8 GetTargetTabBackgroundColor added a hover argument
This change adds the argument to our own codebase, following the change
upstream, although the argument is merely passed along, or ignored on
our case for vertical tabs.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/f6a6419a7d865d3e12fa44cbec2156ee737b4fb9

commit f6a6419a7d865d3e12fa44cbec2156ee737b4fb9
Author: Taylor Bergquist <tbergquist@chromium.org>
Date:   Fri Jul 28 21:54:56 2023 +0000

    [CR23] Use separate hover colors for selected and inactive tabs.

    This CL also makes selected tabs opaque while we're here.

    To accomplish this, the tab selection state and the tab hover state are
    unbundled in TabStyle/TabStyleViews and the color mixers.

    Bug: 1466983
2023-09-06 12:38:49 +01:00
Claudio DeSouza a873b71c0f Move CookieSettings override to base class
The override for `GetCookieSettingWithMetadata` is not necessary anymore
since these transactions got all joined into
`CookieSettingsBase::GetCookieSettingInternal`, for which we now have an
override for.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/d1bd32c0b453d893f789956234f3bf420486f450

commit d1bd32c0b453d893f789956234f3bf420486f450
Author: Christian Dullweber <dullweber@chromium.org>
Date:   Wed Jul 26 12:18:50 2023 +0000

    CookieSettings: Merge metadata handling to CookieSettingsBase

    Move handling of CookieSettingsMetadata to the base class. Split out
    network-service only logic into static helper methods.

    Bug: 1466113
2023-09-06 12:38:49 +01:00
Claudio DeSouza 8e8237907c Move GetCookieSettingInternal override to the base class
Upstream has moved the implementation of `GetCookieSettingInternal` to
`CookieSettingsBase`. This has required reworking brave's third party
override in that function on the base class.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/698b9f36e8354b739da07b2ee36c2e4f70a2fad9

commit 698b9f36e8354b739da07b2ee36c2e4f70a2fad9
Author: Christian Dullweber <dullweber@chromium.org>
Date:   Wed Jul 26 10:32:07 2023 +0000

    CookieSettings: Move GetCookieSettingsInternal to base class

    GetCookieSettingsInternal is implemented twice: Once for the browser
    process and once for the network process. This method is getting
    more and more complicated and there is a risk for bugs due to
    inconsistent behavior.
    This CL extracts a couple small data access functions and moves the
    main GetCookieSettingInternal method to CookieSettingsBase.
    The GetCookieSettingWithMetadata logic in the network service
    will be moved to the base class separately.
2023-09-06 12:38:48 +01:00
Artem Samoilenko 4d7af65e5c [Android] New dialogs for empty states
There are new dialogs that are shown when there are no items to show
(eg. no tabs to show, no history, no downdoaded items etc.). Design team
provided new icons for those dialogs.

Chromium changes:
https://github.com/brave/chromium/commit/29065911522b05a09c397504c8ca4f932c6a77af

Reland "[Empty States] Add empty state illustrations to tab switcher UI"
This is a reland of commit e108b3c

- Previously we rely solely on mModel to determine whether tab switcher is in empty state, however, mModel gets reset to null every time in a postHidingCleanup and thus caused the empty view to show up unexpectedly after ~30s of closing tab switcher. To address this issue, we used a     boolean mIsTabSwitcherShowing in TabListEmptyCoordinator. We set the boolean to true from TabListCoordinator.prepareTabSwitcherView() and set it to false from TabListCoordinator.postHiding. That way, we would know whether the mModel signal is from the actual tab switcher usage or from a cleanup.

Phone demo: https://drive.google.com/file/d/15tmY9gKVocYcUSzC40CCOkuiLX3KoCra/view?usp=sharing

Tablet demo:
https://drive.google.com/file/d/15vT6d-lRE8b2p3XJIhZawb7mmTKTeq9J/view?usp=sharing

Bug: 1431589, 1431588

Original change's description:
> [Empty States] Add empty state illustrations to tab switcher UI
>
> - Add TabListEmptyCoordinator class to initialize empty state resources and use ListObserver to observe mModel to decide when to add /remove empty view.
>     - Add empty view when user close a tab and tab count drops to 0.
>     - Remove empty state view when user add tab
>
> - Apply phone_tab_switcher_empty_state_illustration.xml to icon image view when form factor is phone.
> - Apply tablet_tab_switcher_empty_state_illustration.xml to icon image view when form factor is tablet.
>
> Phone demo: https://drive.google.com/file/d/17deVSRomQUQ1wj5Ml04FTM3tJ0ZXXKZo/view?usp=sharing
> Tablet demo: https://drive.google.com/file/d/1012QQcwxmBoqx7TUjOun7BlO6z2sP4o6/view?usp=sharing
>
> Change-Id: I43b89866ae612a05912b0256790cd538b38417f5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4531843
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Commit-Queue: Theresa Sullivan <twellington@chromium.org>
> Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1147331}

Change-Id: I0126b9a34bca7f0194b2f08c39495c19020cb618

https://github.com/brave/chromium/commit/8128eb6222ea1d237fc2ac0393e40c8ac2de4f1c

[Empty States] Add empty state illustration to Download page
- Add empty state vector drawable and layout.
  - Added downloads_empty_state_illustration.xml
  - Added downloads_empty_state_view.xml (switch to this new layout when FF is enabled)

- Use GM3 Material colors for empty state icon.
  - Since we currently can only use GM3 tokens to get Material dynamic colors in v31 or above, we have to define some not pre-existing GM3 baseline colors with values in color_palette.xml for pre-v31.
  - GM3 Material dynamic colors defined in (need google3 MaterialComponent dependency):  components/browser_ui/styles/android/java/res/values-v31/colors.xml
  - GM3 Material baseline colors defined in: ui/android/java/res/values/color_palette.xml

- Add Download empty state text strings
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_EMPTY_STATE
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_VIEW_OFFLINE_OR_SHARE

Tablet demo:
https://drive.google.com/file/d/1MAtvIlV5sw5U9-zSBmhvfZerqt8jpXfr/view?usp=sharing
Phone demo:
https://drive.google.com/file/d/11TchlrDojWS1XKr6pHtw5ihH_cKdXnT8/view?usp=sharing

Spec: https://www.figma.com/file/wuV3Cx7zhj5O9Hydi7Qxaz/clank-empty-states?node-id=0-1&t=XSFbBmuUjClfkrkH-0

Bug: 1431575

https://github.com/brave/chromium/commit/35223bcab6b70ebf9d01a92715fa3d63965d98d5

[Empty States] Add empty state illustration to History page
- Add empty state vector drawable and layout.
  - Added history_empty_state_illustration.xml
  - Added history_empty_state_view.xml

- In HistoryManager.java, call #mSelectableListLayout.initializeEmptyStateView when Empty State FF is enabled.

- Use ViewStub as Empty State view holder in SelectableListLayout.xml and inflate layout in SelectableListLayout.java when Empty State FF is enabled.

- Add History empty state text strings
  - IDS_HISTORY_MANAGER_EMPTY_STATE
  - IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED

Phone Demo: https://drive.google.com/file/d/13FUM_x9ooStyZfo6gi4ZtniQdf2Sv4oD/view?usp=sharing
Tablet Demo: https://drive.google.com/file/d/1M8kyncAFdbkY-uCXeoQZlphIOd11zf8a/view?usp=sharing

Bug: 1431575

https://github.com/brave/chromium/commit/f45eef2ccb48048ce510318e17804c9f3155a9e4

[Empty States] Add empty state illustration to Bookmark & Reading lis…
…t pages

- Add bookmark_empty_state_illustration.xml & reading_list_empty_state_illustration.xml
- Initialize Empty State view in BookmarkManagerCoordinator
- Set string and image resources in BookmarkManagerMediator depending  on if we are in bookmark or reading list folder

Phone demo: https://drive.google.com/file/d/11CBTJz4g9mI-X27C8chmdKFJg6WMgwMQ/view?usp=sharing
Tablet demo: https://drive.google.com/file/d/12-8oYox0g806mB3TFJqpzps4u1mMNLl7/view?usp=sharing

Bug: 1431572, 1431580
2023-09-06 12:38:48 +01:00
Artem Samoilenko 8c6e9af391 Test adjustment for a new sync type AUTOFILL_WALLET_CREDENTIAL
Chromium change:
https://github.com/brave/chromium/commit/18d3a8c7c0a0b327c295cd6aa2904af82c9f374d

[CVV Storage] Setup new sync type AUTOFILL_WALLET_CREDENTIAL
DD- go/pay-autofill-cvv-storage-chrome

Bug: 1458044
2023-09-06 12:38:48 +01:00
Claudio DeSouza 90d53529e2 Straggler format changes for skus
For some reason codes in skus keeps coming up whenever format is run
against the branch. This change is purely formatting, to satisfy that.
2023-09-06 12:38:48 +01:00
Claudio DeSouza 0105a3b234 kWebEnvironmentIntegrity moved into blink
This feature flag is now being generated as part of blink, and therefore
disabling it had to be moved into blink.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f47a22906b2899412e79a2727355efa9cc8f5bd

commit 6f47a22906b2899412e79a2727355efa9cc8f5bd
Author: Peter Birk Pakkenberg <pbirk@chromium.org>
Date:   Fri Jul 21 06:56:00 2023 +0000

    [wei] Ensure Origin Trial enables full feature

    This CL moves the base::Feature from content_features.h to
    a generated feature from runtime_enabled_features.json5.

    This means that the base::Feature can be default-enabled
    while the web API is controlled by the RuntimeFeature, which will
    still be default-disabled.

    An origin trial can enable the RuntimeFeature, which will
    allow full access to the API, provided the base::Feature is also
    enabled (see change to origin_trial_context.cc).

    Meanwhile, the base::Feature can be disabled through Finch as a
    kill-switch for the whole feature, and prevent origin trials
    from turning the feature on.

    Tests have been added to WebView test, as it allowed for easy
    spoofing of responses on a known origin.

    Bug: 1439945
2023-09-06 12:38:48 +01:00
Claudio DeSouza 9f51d666ce Fix transient inclusion vr build flags
A public //content header for url constantly was transiently making vr
buildflags a dependency. This change adds that dependency to
//brave/extensions:common.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/c4eee9a301891f6ad397f49add6ad33a19a96a6a

commit c4eee9a301891f6ad397f49add6ad33a19a96a6a
Author: Mahmoud Ahmed <mahmoudaahmedd@gmail.com>
Date:   Fri Jul 21 17:19:24 2023 +0000

    Introduces the initial version of the WebXR Internals debugging page

    Summary:
    This commit introduces the initial version of the WebXR Internals
    debugging page. The page will display relevant information and data
    for debugging purposes.

    The following features have been implemented:

     - Device Info: Displays information about the user's system,
       including GPU driver, GPU vendor ID, operating system name and OS
       version.

    Further work is needed to complete the remaining attributes in the XR
    Session Info section and integrate data fetching from the Blink module
    for the interactive charts.

    Bug: 1458661
2023-09-06 12:38:48 +01:00
Claudio DeSouza 77cdc3a372 Fix duplicate test names
Upstream is now checking for the occcurence of duplicate test names.
This has revealed a few tests of our own using the same name, even
though they were located in different namespaces.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/668abce7c2d52ff321ce4c361372874d90c0856a

commit 668abce7c2d52ff321ce4c361372874d90c0856a
Author: Bruce Dawson <brucedawson@chromium.org>
Date:   Fri Jul 21 20:18:32 2023 +0000

    Warn on duplicate test names

    In certain unpredictable circumstances duplicate test names can cause
    the test launcher to crash. Duplicate test names can also cause
    confusion about exactly which test has failed, and presumably
    complicate tracking of test failures over time. This change adds
    checking for duplicate test names to make them visible.

    Testing of this change found many duplicate test names, usually caused
    by copy/paste. All of these have now been fixed.

    Bug: 1465008
2023-09-06 12:38:48 +01:00
Artem Samoilenko 437e799f70 [Android] Fixes for unit tests 2023-09-06 12:38:48 +01:00
Artem Samoilenko 145681c02a [Android] Remove tab groups auto creation
Chromium change:
https://github.com/brave/chromium/commit/aa78b431380e08988cccde7e6e2a167568da64a9

[Tab Groups] Remove auto creation and menu order params
Remove tab group auto creation and menu order params as these are
launched in their current and final states.

Tab Group Auto Creation is disabled.
New Tab In Group is first in the context menu.

Bug: 1188370
2023-09-06 12:38:48 +01:00
Claudio DeSouza 95c4ecff65 Corrrect to vector<raw_ptr<T>> upstream use
Chromium has been gradually phasing out naked pointers, and replacing it
with instrumentation that allows dangling pointer detection. This time,
all vectors storing pointer types have been changed to store `raw_ptr`
instances, annotated with dangling tolerance.

This change corrects brave code to reflect the new configuration of
upstream code. In some cases, the removal of `auto` is enough to force a
conversion from the `raw_ptr` type, to the underlying pointer, and
that's what was nearly everywhere. In other cases, our own vector type
spelling had to be changed to match what was being done upstream.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/8164060989632ef27c0e86809572183f55f02e83

commit 8164060989632ef27c0e86809572183f55f02e83 (tag: 117.0.5911.3)
Author: Ali Hijazi <ahijazi@chromium.org>
Date:   Thu Jul 27 00:51:06 2023 +0000

    Rewrite vector<T*> into vector<raw_ptr<T>>

    First Patch:
       1- Introducing alias dangling_raw_ptr<T> =
            raw_ptr<T,DanglingUntriaged>
       2- Annotate Some fields with RAW_PTR_EXCLUSION
       3- Introduce some needed functions
       4- Preliminary fixes
       5- Set VectorRawPtrExperiment synthetic field trial to enabled

    Second patch: Automatic rewrite
    Later patches: Manual fixes

    Bug: 1432993
2023-09-06 12:38:48 +01:00
Claudio DeSouza fe0721c07c Bookmark UUID constants moved in their own header
This constants used to the scope of `BookmarkNode`, but now they are
placed in their file.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/55a58b5bf5daa13dfa36c705fe460460a211aa58

commit 55a58b5bf5daa13dfa36c705fe460460a211aa58
Author: Matt Jones <mdjones@chromium.org>
Date:   Mon Jul 24 22:01:58 2023 +0000

    Move known bookmark UUIDs to separate file

    This patch moves all the well-known, reserved UUIDs for bookmarks to a
    separate file.
2023-09-06 12:38:48 +01:00
Claudio DeSouza 10b111ef80 RFH storage_key() renamed to GetStorageKey
This is a mere renaming of the function, as it was non-compliant with
their style guide.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/8338d9fa2da53d9d47b5379e6e3f281c5ab092d2

commit 8338d9fa2da53d9d47b5379e6e3f281c5ab092d2
Author: Mariam Ali <alimariam@google.com>
Date:   Mon Jul 24 16:57:31 2023 +0000

    Refactor: Rename storage_key() to GetStorageKey() in RenderFrameHost
2023-09-06 12:38:48 +01:00
Claudio DeSouza 708e7943e1 IWYU fixes
This change corrects missing inclusions that for whatever reasons have
broken on the latest tag.
2023-09-06 12:38:47 +01:00
Claudio DeSouza e3ffbc3fe2 Use raw_ref for reference member data
Upstream has turned on a clang plugin check to prevent declaring
reference member data. This has been turned on for Linux only at the
moment.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/507a79fc52eb714185c54acfd5d46f39c8950318

commit 507a79fc52eb714185c54acfd5d46f39c8950318
Author: Ali Hijazi <ahijazi@chromium.org>
Date:   Wed Jul 19 14:23:14 2023 +0000

    Reland "Enable raw_ref check on linux"

    This is a reland of commit d1ff03b57f992b7e856aa247598385a2a5f4ee09

    Original change's description:
    > Enable raw_ref check on linux
    >
    > clang will now show warnings where raw_ref<T> could be used.
    >
    > Change-Id: I2c88bbe23cef7431f3d5ede46e9a661e4ad89e5a
    > Bug: 1446146
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4534995
    > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    > Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
    > Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1153404}

    Bug: 1446146
2023-09-06 12:38:47 +01:00
Claudio DeSouza a9255fafd2 ConstCastIterator deleted upstream
This utility function merely converts an const interator to a multable
on, for a container one has access to.

This change adds a simplified version of this utility funtion to the
tranlation unit where this use occurred, preserving the code
functionality as before.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/adfdbaf325a5848e12c70fe22722eb71bad1791f

commit adfdbaf325a5848e12c70fe22722eb71bad1791f
Author: Andrew Rayskiy <greengrape@google.com>
Date:   Fri Jul 21 15:10:39 2023 +0000

    Remove base::ConstCastIterator(...), which is now unused.

    Bug: None
2023-09-06 12:38:47 +01:00