Commit Graph
7032 Commits
Author SHA1 Message Date
Mario Sanchez Prada 4d76bd2ec3 Remove BraveConfigurator::GetBrand() trivial override
The method has been removed from the parent class.

Chromium change:

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

commit b722fecc8f24471cb11e6fbdca93ea0a2f656e75
Author: Joshua Pawlicki <waffles@chromium.org>
Date:   Thu Nov 18 22:51:16 2021 +0000

    Updater: Send per-item brand code.

    Bug: 1259972
2022-01-24 15:34:02 -05:00
Mario Sanchez Prada 6d86e0f8ad Updated strings for Chromium 98.0.4723.0. 2022-01-24 15:34:00 -05:00
samartnik 8c35e65757 [Android] Make default_icon_color dynamic
Chromium change:
https://chromium-review.googlesource.com/c/chromium/src/+/3276657

[GMNext] Make default_icon_color dynamic

Bug: 1216642
2022-01-24 15:33:55 -05:00
Mario Sanchez Prada c22ae2f4b4 Adapt to removal of |enable_extension_apis| from |WebUIBubbleManagerT|
We need to manually add a ChromeExtensionWebContentsObserver to the
WebView's WebContents now that the |enable_extension_apis| parameter
is gone from the constructor, which we used to set to |true| causing
the BubbleContentsWrapper to do it for us.

Chromium change:

https://github.com/chromium/chromium/commit/183029096a06ae326108700c8f6272c6cec9b174

commit 183029096a06ae326108700c8f6272c6cec9b174
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Tue Nov 16 19:45:05 2021 +0000

    Introduce ContentBrowserClient::AttachUniversalWebContentsObservers.

    Problem description
    ===================

    Before this CL, there was a discrepancy in how Chrome Extensions were
    handled in the Browser process VS the Renderer processes:

    1. Code in a Renderer process ensures that content scripts are injected
       into *all* elligible documents (ones with URLs that match patterns
       requested by an extension).  This Renderer-side code is agnostic to
       whether the document is in a browser tab or in a different flavor of
       WebContents.

       This universal applicability of content scripts is desirable - if a
       user installs an extension to modify certain documents (e.g. change
       the behavior of https://example.com) then such user intent should be
       respected in all WebContents hosting such documents.

    2. Code in the Browser process would create ExtensionWebContentsObserver
       (EWCO) only for some, but not for all WebContents.  This was because
       when creating a new flavour of WebContents it was possible to miss
       the responsibility to construct EWCO - we've identified multiple
       WebContents flavours were EWCO was missing.

    The discrepancy between the Browser and the Rednderer processes would
    mean that some content scripts are injected but:

    A. They cannot talk to extensions::mojom::LocalFrameHost (which is
       bound by EWCO::BindLocalFrameHost) and therefore extension API calls
       do not work

    B. They are not recognized by ContentScriptTracker (which relies on
       notifications like EWCO::ReadyToCommitNavigation).  This was
       responsible for majority of DumpWithoutCrashing reports tracked in
       https://crbug.com/1212918.

    Changes in this CL
    ==================

    This CL adds a new method to ContentBrowserClient -
    AttachUniversalWebContentsObservers (which gets called by the //content
    layer for every WebContents after it gets created and initialized).
    Implementation of the new method in ChromeContentBrowserClient
    constructs ChromeExtensionWebContentsObserver for each WebContents.

    For more background (and discussion of alternative approaches for
    addressing the problem) please see the document here:
    https://docs.google.com/document/d/1zITHyso0axNdAZV3qySgsoWW-p6jOEKbWqoVJbOW92c/edit?usp=sharing

    Bug: 1212918
2022-01-24 15:33:54 -05:00
Mario Sanchez Prada e11b736a58 Don't ever return fixed plugins data, use Brave's farbling method
The NavigatorPluginsFixed feature is now unconditionally enabled, so
we need to add some extra code to make sure that we always rely on
Brave's farbling mechanism, instead of returning upstream's fixed
plugins data.

Chromium change:

https://github.com/chromium/chromium/commit/c2abba012946a341b479821594eccaf45c893b3f

commit c2abba012946a341b479821594eccaf45c893b3f
Author: Mason Freed <masonf@chromium.org>
Date:   Tue Nov 16 00:38:55 2021 +0000

    Remove the NavigatorPluginsFixed feature flag

    This feature shipped successfully in M94, with no reported bugs.
    As such, this CL removes the feature flags. Note that the various
    uses of |should_return_fixed_plugin_data_| need to stay, as they
    are still used to re-enable the dynamic plugin lists for apps,
    which is controlled via:
       GetSettings()->GetAllowNonEmptyNavigatorPlugins()
    until at least June, 2022.

    Bug: 1171373,1164635
2022-01-24 15:33:52 -05:00
Mario Sanchez Prada 3ef694940b Adapt to new signature of ChromeContentBrowserClient::CreateBrowserMainParts
Chromium changes:

https://chromium.googlesource.com/chromium/src.git/+/fbeeb1c228427bcc94d22747210309b99f88c0b1

commit fbeeb1c228427bcc94d22747210309b99f88c0b1
Author: Gabriel Charette <gab@chromium.org>
Date:   Wed Nov 10 20:50:06 2021 +0000

    [content] Make ContentMainParams and MainFunctionParams move-only

    This is taking care of a long-standing TODO to move these OnceClosure
    holders rather than copy them around with their OnceClosure* members.

    This is a precursor to
    https://chromium-review.googlesource.com/c/chromium/src/+/3187153/35#message-fcc92e9f85e73f0e5ba6c03610a95cda8736f1f9
    which highlighted a problem where some tests see a non-null
    MainFunctionParams::ui_task but running the closure results in a UAF.
    Logs show that the test hitting the UAF is not the one setting this
    field. This CL makes that impossible and fixes the issue in the
    follow-up CL.

    This CL is intended to be a logical no-op.
    This CL touches a lot of files and must happen all at once.

    The core change is that ContentMainParams and MainFunctionParams's
    moveable fields (ui_task, created_main_parts_closure, and startup_data)
    are now held by moveable types rather than raw pointers.

    This trickles in the following chain:
    main() (in various *_main.cc)
    (or SetUp() in !OS_ANDROID browser_test_base.cc)
      -> ContentMain()
        -> ContentMainRunnerImpl::Initialize()
          (forwards arg into MainFunctionParams)
          -> RunBrowser()
            -> BrowserMain()
              -> BrowserMainRunnerImpl::Initialize()
                -> BrowserMainLoop (stores MainFunctionParams)
                -> BrowserMainLoop::Init
                  -> ContentBrowserClient::CreateBrowserMainParts()
                    -> (Embedder)ContentBrowserClient::CreateBrowserMainParts()
                      -> (Embedder)BrowserMainParts(Platform)
                        -> (Embedder)BrowserMainParts
          -> RunOtherNamedProcessTypeMain()
            -> (Embedder)ContentMainDelegate::RunProcess()
            (or)
            -> FooMain() (kMainFunctions)
            (or)
            -> RunZygote()
              (creates its own MainFunctionParams)
              -> (Embedder)ContentMainDelegate::RunProcess()
    (on OS_ANDROID, browser_test_base.cc calls directly into
     ContentMainDelegate::RunProcess())

    Few of these needed the params after passing them down so a move-only
    model was simple to adapt (even if invasive). The few exceptions like
    BrowserMainRunnerImpl::Initialize consuming |created_main_parts_closure|
    are better off in the new model (where they take the OnceClosure before
    passing down the params) because that prevents others down the chain
    from having access to a OnceClosure they shouldn't invoke anyways.

    Noteworthy:
     - ContentMainDelegate::RunProcess():
       Returned an exit_code >= 0 to indicate the embedder elected to handle
       the run request given these params. With move-only semantics it is
       necessary to return the params back when the embedder declines
       handling this run request. An absl::variant return value is used
       to satisfy this requirement.

    - content/public/test/test_launcher.h : GetContentMainParams():
      Becomes CopyContentMainParams() and only exposes a copy of copyable
      params. Uses new ContentMainParams::ShallowCopyForTesting() which
      verifies that moveable fields are still null by that time as should be
      the case in the order browser tests are initialized.

    - MainFunctionParams::command_line being const& violated the style-guide
      rule to "avoid defining functions that require a const reference
      parameter to outlive the call". This also prevented moving. The type
      was hence switched to a const CommandLine*.

    - BUILD.gn changes for nacl_helper_win_64 which requires static linking
      of its minimal //content deps (was previously missing a dep but was
      getting away with it because MainFunctionParams was .h only; required
      now with .cc). This was already done for static_switches and this CL
      adds static_main_function_params, reusing a similar static_features
      target that already existed but was no longer required in
      /c/nacl/broker, cleaning that up by replacing rather than copying that
      target's definition in this CL.

    - ContentMainParams::minimal_browser_mode was weirdly passed as a
      parameter to ContentMainRunner::Run(bool start_minimal_browser) but
      that method also has access to the ContentMainParams originally passed
      via ContentMainRunner::Init(). Passing the param again from Run()
      would be a use-after-move in content_main.cc, instead
      content_main_runner_impl.cc was updated to use the param it already
      has in store.

    Bug: 1175074
2022-01-24 15:33:44 -05:00
Mario Sanchez Prada 06f884ff74 Remove includes to base/macros.h using base/ignore_result.h when needed
Only a couple of files really need to include this header now to use
ignore_result(), and we can just drop the include from everywhere else.

Chromium changes:

https://chromium.googlesource.com/chromium/src.git/+/2e6be1400ab678f21d871d0d3a1199912967324f
https://chromium.googlesource.com/chromium/src.git/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88d
https://chromium.googlesource.com/chromium/src.git/+/3a3f9436142e712d4a7e2a962d85154876fa395f

commit 2e6be1400ab678f21d871d0d3a1199912967324f
Author: Peter Boström <pbos@chromium.org>
Date:   Sat Nov 13 01:28:25 2021 +0000

    Rename "base/macros.h" => "base/ignore_result.h"

    This file only contains ignore_result() and is no longer a collection of
    macros.

    This change fixes a couple of missing IWYU removals as well.

    Bug: 1010217

commit 5666ff4f5077a7e2f72902f3a95f5d553ea0d88d
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 12 03:40:24 2021 +0000

    Remove most remaining unused "base/macros.h"

    Removes `#include "base/macros.h"` from remaining .cc, .h and .mm files
    that do not contain `ignore_result(` and do not trigger pre-commit or
    pre-upload errors.

    Bug: 1010217

commit 3a3f9436142e712d4a7e2a962d85154876fa395f
Author: Peter Boström <pbos@chromium.org>
Date:   Mon Nov 8 21:04:37 2021 +0000

    Add #include "base/macros.h" for ignore_result()

    This fixes IWYU for existing instances of ignore_result() to make
    removal of #include "base/macros.h" from files using it for DISALLOW_*
    macros easier.

    Bug: 1010217
2022-01-24 15:33:44 -05:00
Mario Sanchez Prada 732d93f678 Updated strings for Chromium 98.0.4706.0. 2022-01-24 15:33:42 -05:00
Mario Sanchez Prada 5475f3e6ef IWYU: base/environment.h 2022-01-24 15:33:38 -05:00
Mario Sanchez Prada 0d3ba05905 Add //ui/base/x to //brave/components/brave_ads/browser dependencies
This target is no longer in the public_deps for //ui/base, so we need
to explicitly list it now to avoid link errors.

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/2b98feda0cb0ef000c2f41d3f729cf7189bf394b

commit 2b98feda0cb0ef000c2f41d3f729cf7189bf394b
Author: Maksim Sisov <msisov@igalia.com>
Date:   Fri Nov 5 16:22:03 2021 +0000

    ozone: //ui/base: clean up from USE_X11 1/*

    This is another CL that removes USE_X11 define and
    gn arg usage from //ui/base and also removes
    IsUsingOzonePlatform condition as it's no longer
    needed as it always resolves to true.

    Please note that //ui/base used to have
    //ui/base/x in public_deps. That resulted in other
    components implicitly depending on the //ui/base/x
    as well. However, after it was deleted, it was
    required to fix deps in //remoting/host,
    //components/viz/service and //chrome/test/chromedriver.

    Changes:
    1) Moved hit_tests_x11 to //ui/platform_window/x11
    2) Moved os_exhange_data_provider_x11 to //ui/platform_window/x11
    3) Fixed deps
    4) //ui/base:ui_base_unittests no longer includes //ui/base/x:unittests.
    Instead, the //ui/base/x:unittests target is included in
    //ui/platform_window/x11:x11_unittests and these base x11 unittests
    run as part of x11_unittests.

    Bug: 1096425
2022-01-24 15:33:38 -05:00
Mario Sanchez Prada bbf5fd3fe9 Remove deprecated DISALLOW_ macros from Brave-specific code
Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900
per style arbitration [1]. This commit replaces the macros with deleted
constructors and methods, which is preferred by the Google C++ Style
Guide [2][3].

Also remove unneeded "base/macros.h" #includes when possible.

This CL is created semi-mechanically with remove_disallow and
remove_base_macros [4].

[1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ
[2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
[3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types
[4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb

commit d002a3bee7ae75780b604d17df19291a3dd303fb
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 5 17:17:19 2021 +0000

    Remove DISALLOW_ macros from base/macros.h

    This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
    DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
    updated to no longer check for these macros.

    IWYU removal is left as a separate change just in case this needs to be
    reverted.

    Bug: 1010217
2022-01-24 15:33:37 -05:00
Mario Sanchez Prada 0cbd43fc58 Updated strings for Chromium 98.0.4695.0. 2022-01-24 15:33:36 -05:00
sergey p d94ab7f6d4 Add images data source to wallet page and panel 2022-01-24 22:43:46 +03:00
Cepera a4168add4f Fix unstable test BraveWalletEthereumChainTest.AddDifferentChainsNoSwitch (#11962) 2022-01-23 21:42:55 +03:00
Cepera f337a47cf8 Add chain validation to wallet_addEthereumChain api call (#11930) 2022-01-22 11:26:36 +03:00
Taher a5f5e571fb Merge pull request #11952 from brave/test_render_unittest
Use RenderViewHostTestEnabler in unit test
2022-01-21 17:55:15 -08:00
Taher c9bf428a1d Use RenderViewHostTestEnabler in unit test 2022-01-21 09:59:41 -08:00
Deep 005fa87ba8 Reformat code 2022-01-21 12:22:19 -05:00
Deep 2925c7a27a Resolve contribution 2022-01-21 12:21:19 -05:00
Deep daee522582 Update monthly contribution UI
Update banner code
2022-01-21 12:21:19 -05:00
Linh c215ec61bd Merge pull request #11917 from brave/linh-replace-crlsets-with-redirector
Replace crlsets with redirector
2022-01-21 15:02:02 +09:00
Szilard Szaloki 2a44eea2e9 Merge pull request #11857 from brave/sszaloki-20427-uphold-customer-due-diligence
Handling Uphold's CDD (customer due diligence) process.
2022-01-20 19:02:49 +01:00
Taher 952a9adb52 Merge pull request #11817 from brave/shields_panel_adblock_types
Added a method that returns AdblockMode
2022-01-20 07:35:30 -08:00
Linh Kikuchi 2ec112585a Fix lint and network audit for dict 2022-01-20 20:28:39 +09:00
Linh Kikuchi befc43b563 Fix lint and network audit for dict 2022-01-20 20:06:51 +09:00
Szilard Szaloki 4c3c01be7d Handling Uphold's CDD (customer due diligence) process.
- introducing `upholdCustomerDueDiligenceRequiredModal` that tells the user to complete the CDD survey on Uphold
- parsing out `verifications.customerDueDiligence.status` from the response of `GET https://api.uphold.com/v0/me`
- sending the user to `NOT_CONNECTED`/`DISCONNECTED_VERIFIED` if CDD is required for them
- and showing `upholdCustomerDueDiligenceRequiredModal` (and `kWalletDisconnected` if already VERIFIED)
- adding test cases
2022-01-20 11:16:32 +01:00
Linh Kikuchi 4b1996c54c Replace crlsets with redirector 2022-01-20 15:35:51 +09:00
Linh Kikuchi 03478cd68d Replace crlsets with redirector 2022-01-20 15:33:59 +09:00
Taher be4df7d877 Added unit test for shields data controller 2022-01-19 16:47:14 -08:00
Taher be9dd853b3 Added method to read and set AdBlockMode on shields panel v2 2022-01-19 11:37:57 -08:00
Brian R. Bondy 1b3052b129 Merge pull request #11876 from brave/signTypedData_v4-looksrare
Sign typed data v4 fixes for looksrare.org and other dapps
2022-01-19 13:05:34 -05:00
Brian R. Bondy 8c1fd1b113 Handle eth_sendTransaction data errors
Before it would crash because of a null parse data result that was being used

You can see the null check added in this commit with !tx_data_1559
2022-01-19 13:05:05 -05:00
Brian Clifton be57e528ab Merge pull request #11894 from brave/skus_env_feature_flags
Added feature flags for choosing skus environment
2022-01-19 10:27:50 -07:00
Simon Hong 6c2304b688 Added feature flags for choosing skus environment
When one of option is selected except default, it's value is passed
via --skus-env command line switch.

fix https://github.com/brave/brave-browser/issues/20557
2022-01-19 16:46:53 +09:00
bridiver 29fb678906 unexport guard should match verify_chrome_framework_order, not enable_stripping 2022-01-18 13:49:42 -07:00
iefremov c650cee90a Merge pull request #10694 from brave/ipfs_query
Preserve query strings on IPFS redirect
2022-01-18 21:17:29 +07:00
iefremov 807d6d54a3 Merge pull request #11600 from brave/ie_p3a_json2
Introduce JSON P3A pings that duplicate the legacy pings.
2022-01-18 20:58:41 +07:00
Brian R. Bondy b5c47e70f2 Allow 0x as input to wallet functions
When converting to vector it is empty, when converting to int and uint it is 0
2022-01-17 14:54:03 -05:00
Ivan Efremov 9c26c8721f Add p3a-json to network audit allowlist. 2022-01-17 19:40:06 +07:00
Aleksey Seren 2afe5e4949 Support custom notification changes on Android 12.
fix https://github.com/brave/brave-browser/issues/19145
2022-01-17 17:05:42 +07:00
Brian R. Bondy 13784cacc3 Only build unexports for component builds 2022-01-16 19:58:16 -05:00
Brian Clifton f62447cdf4 Merge pull request #10847 from brave/bsc-skus-sdk-keyed
Integrate with SKU SDK (Rust) and provide safe credential interception for VPN
2022-01-15 02:38:10 -07:00
Brian Clifton 45486c613b Fixes found as CI ran
- Fix for Android (VPN enabled flag check)
- Fix for iOS (include file was renamed)
- lint fixes
- initialize SKU feature for VPN tests
2022-01-15 00:18:52 -07:00
Pete Miller 67a9388252 New Tab Page WebUI - remove widget visibility migration and set the initial pref value to false
This should have no effect since all (or most) existing users would be migrated with the last 2 major releases and now only new users would be affected
2022-01-14 16:45:27 -08:00
Mario Sanchez Prada f38f5d63b2 Merge pull request #11850 from brave/issues/20504
[network-audit] Add test coverage for the New Tab Page
2022-01-14 13:18:29 +01:00
Mario Sanchez Prada 87144bb59e [network-audit] Add test coverage for the New Tab Page
As reported in https://github.com/brave/brave-browser/issues/20501,
the NTP was making outbound requests to ftx.com at startup without
user opt-in, and the network-audit didn't catch that case because
it was NOT loading a NTP as part of the different checks it does
at BraveNetworkAuditTest.BasicTests.

This patch adds explicit test coverage for that case by loading
brave://newtab and waiting 5 minutes, like with the other checks.

Resolves https://github.com/brave/brave-browser/issues/20504
2022-01-14 12:01:00 +01:00
Cepera 0229c66638 Do not redirect subresources for non-ipfs pages (#11799)
* Do not redirect subresources for non-ipfs pages

* Check frame url instead of tab origin
2022-01-14 12:29:15 +03:00
Cepera b8b5932008 Add multiple keyrings support and Filecoin balances requests (#11687)
* Improved multi-keyrings management and added backed for filecoin requests

* Rename BraveCoins -> CoinType

* Change coin indexes to meet BIP-0044

* Change CoinType.FILECOIN -> CoinType.FIL
2022-01-14 11:16:23 +03:00
Brian Clifton d634f38c92 Final cleanups
- more clear variable names for cargo.gni
- remove `cxx-build` as a dep from browsers/rs cargo.toml
- remove deprecated friend usage in SkusServiceFactory
- Proper null check in GetForContext (SkusServiceFactory)
2022-01-13 23:20:56 -07:00
Brian Clifton ab7c90ca32 More review feedback updates:
- renaming PageController => JSHandler
- fixing guard usage (leaving TODOs where work required)
- pref_names split into 2 files
- BraveVpnServiceDesktop now gets passed pending remote and binds
- SKU mojom ref in VPN (desktop) will now rebind if connection broken
- Updated comments (documentation)
- Fixed callback usage in SkusServiceImpl
- Fixed gn_check violations
- Default SKU feature to true on iOS
- Have a common preferences registration (avoid iOS duplicating)
2022-01-13 23:20:56 -07:00