Commit Graph
98 Commits
Author SHA1 Message Date
Brian R. Bondy 4fc7a3b837 Update to new Wallet icons
Fix https://github.com/brave/brave-browser/issues/18697
2021-10-12 12:24:12 -04:00
mkarolin 9d5fd5c76c Fixes Additional Settings button text being cutoff.
Fixes brave/brave-browser#17461
2021-09-21 14:06:53 -04:00
Pete Miller cd42808073 Settings: correctly modify templates for elements which are defined before brave's overrides have run 2021-08-18 10:59:57 -04:00
Pete Miller d305abc747 Settings: override a classes "static get properties" via subclassing the actual element.
We need to:
- Make sure chromium's component does not get registered, so we add a dep to a JS module which makes sure the element name is on an ignore list
- Define our own element which subclasses chromium's one and accesses and modifies the original static property
2021-08-18 10:59:57 -04:00
Pete Miller b781d9fd2f Settings: avoid timing issues with creating elements before polymer property binding is setup
Previously we were creating the elements directly on the document. That led to the constructor being called immediately. When we create as a template element first then we avoid that issue.
2021-08-18 10:59:56 -04:00
Mario Sanchez Prada 6737cfc711 Update remaining references to br_toolbar_search_field.m.js
They should be pointing to br_toolbar_search_field.js now, otherwise
this will break the build.
2021-08-18 10:58:51 -04:00
Mario Sanchez Prada 76d0c7919e Disable debug mode for ui/webui/resources/polymer_overriding.js
These fixes 3 tests failing due to producing excessive output:

  * BraveDarkModeFingerprintProtection.SettingsPagesCheck
  * SidebarBrowserTest.BasicTest
  * SidebarBrowserTest.WebTypePanelTest
2021-08-18 10:58:39 -04:00
Mario Sanchez Prada 3b73a100bd Update remaining references to br_toolbar.m.js to br_toolbar.js instead
This was breaking the following 37 tests because of not being able
to find br_toolbar.m.js in the Brave resources map used for testing:

  * BraveContentBrowserClientTest.CanLoadCustomBravePages
  * RewardsBrowserTest.BackupRestoreModalHasNoNotice
  * RewardsBrowserTest.ResetRewards
  * RewardsBrowserTest.ShowACPercentInThePanel
  * RewardsContributionBrowserTest.AutoContributeWhenACOff
  * RewardsContributionBrowserTest.AutoContribution
  * RewardsContributionBrowserTest.AutoContributionMultiplePublishers
  * RewardsContributionBrowserTest.AutoContributionMultiplePublishersUphold
  * RewardsContributionBrowserTest.CheckIfReconcileWasReset
  * RewardsContributionBrowserTest.CheckIfReconcileWasResetACOff
  * RewardsContributionBrowserTest.MultipleRecurringOverBudgetAndPartialAutoContribution
  * RewardsContributionBrowserTest.PanelMonthlyTipActions
  * RewardsContributionBrowserTest.PanelMonthlyTipAmount
  * RewardsContributionBrowserTest.PendingContributionTip
  * RewardsContributionBrowserTest.ProcessPendingContributions
  * RewardsContributionBrowserTest.RecurringAndPartialAutoContribution
  * RewardsContributionBrowserTest.SplitProcessOneTimeTip
  * RewardsContributionBrowserTest.SplitProcessorAutoContribution
  * RewardsContributionBrowserTest.TipConnectedPublisherAnon
  * RewardsContributionBrowserTest.TipConnectedPublisherAnonAndConnected
  * RewardsContributionBrowserTest.TipConnectedPublisherConnected
  * RewardsContributionBrowserTest.TipNonIntegralAmount
  * RewardsContributionBrowserTest.TipVerifiedPublisher
  * RewardsContributionBrowserTest.TipWithVerifiedWallet
  * RewardsContributionBrowserTest.RecurringTipNonIntegralAmount
  * RewardsNotificationBrowserTest.InsufficientNotificationForACNotEnoughFunds
  * RewardsNotificationBrowserTest.InsufficientNotificationForInsufficientAmount
  * RewardsNotificationBrowserTest.InsufficientNotificationForVerifiedInsufficientAmount
  * RewardsP3ABrowserTest.WalletBalanceLessThan10BAT
  * RewardsP3ABrowserTest.WalletBalanceLessThan50BAT
  * RewardsP3ABrowserTest.WalletBalanceMoreThan50BAT
  * RewardsP3ABrowserTest.WalletStateWalletCreatedGrantsClaimedFundsAdded
  * RewardsP3ABrowserTest.WalletStateWalletCreatedGrantsClaimedNoFundsAdded
  * RewardsP3ABrowserTest.WalletStateWalletCreatedNoGrantsClaimedFundsAdded
  * RewardsPublisherBrowserTest.VisitRegisteredPublisher
  * RewardsPublisherBrowserTest.VisitUnverifiedPublisher
  * RewardsPublisherBrowserTest.VisitVerifiedPublisher
2021-08-18 10:58:39 -04:00
Pete Miller ec0eed4829 Polymer overriding - replace cr-toolbar with br-toolbar always, without patching 2021-08-18 10:58:38 -04:00
Pete Miller 9158e4ea79 Polymer overriding supports direct PolymerElement subclassing 2021-08-18 10:58:38 -04:00
mkarolin dfe0eb7f56 Fixes crash on Windows due to unknown key. 2021-08-18 10:53:09 -04:00
mkarolin 01af140ac1 Normialized line endings after adding .gitattributes. 2021-08-05 10:22:04 -04:00
Brian Clifton 994390ebdf Merge pull request #8910 from rahulsnkr/history-search-field-fix
Fix#7398 - Resolves Delete and Cancel buttons not being shown when selecting items after searching history
2021-06-24 10:01:37 -07:00
Rahul Sankar 8a20b935f9 Fix#7398 - Resolves Delete and Cancel buttons not being shown when selecting items after searching history 2021-06-16 19:31:35 +05:30
Brian R. Bondy bf2c8c0a41 Split out Ethereum Remote Client from new Brave Wallet 2021-05-27 13:11:30 -04:00
Mario Sanchez Prada f5c01f0a3d Migrate legacy HTML import for cr_search_field_behavior.html
Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/72af65941757284c13927c36a582426144b4043a

commit 72af65941757284c13927c36a582426144b4043a
Author: rbpotter <rbpotter@chromium.org>
Date:   Thu Mar 25 19:17:57 2021 +0000

    WebUI: Check in Polymer 3 cr_search_field

    Bug: 1184053
2021-05-05 12:24:41 +02:00
Terry Mancey 86f15eb5e9 Implement new custom ad notification design 2021-04-28 16:57:54 -05:00
Moritz Haller 75e7d7f50e Add anti-targeting frequency capping for Brave Ads 2021-04-01 17:47:52 +01:00
mkarolin 24bf5fd148 Fixes overriding WebUI default fonts.
Function in web_ui_util.cc is no longer used to get the
text_defaults_md.css resource for shared resources. Keep our override
for the function resouce because it's still used in several places.

Additionally, copy over our text_defaults_md.css via util.js so that
it's used when chromium GRD is auto generated.

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/ba11d6dc4a110c2c456eb453b445832847230b5e

commit ba11d6dc4a110c2c456eb453b445832847230b5e
Author: dpapad <dpapad@chromium.org>
Date:   Wed Feb 24 18:26:57 2021 +0000

    WebUI: Replace SharedResourcesDataSource with a regular WebUIDataSource.

    SharedResourcesDataSource was a custom class directly subclassing
    URLDataSource (and used for serving chrome://resources URLs). By doing
    so it included a lot of duplicated functionality for code that is
    already available in regular WebUIDataSourceImpl subclasses, for
    example

     - Registering resources
     - Registering loadTimeData strings
     - Calculating mime types based on a path's extension
     - Locating and serving WebUI files from pak files
     - Overriding specific CSP policies

    By using a regular WebUIDataSourceImpl a lot of duplicated code is
    deleted. Moreover, WebUIDataSourceImpl is a more mature class, that is
    heavily used across WebUI. For example this CL helped discover a bug
    where $i18n{...} string placeholders where incorrectly used in
    cr_components/ (fixed at r854879) because of CHECK()s that did not
    exist in SharedResourcesDataSource.

    In order to support chrome://resources/css/text_defaults.css $i18n{...}
    replacements, web_ui_url_loader_factory.cc has been modified to perform
    $i18n{...} replacements in CSS files too (previously only done for HTML
    files, and conditionally for JS files).

    Bug: 1179207
2021-03-23 14:55:44 -04:00
Mario Sanchez Prada c87977b5d2 Specify a resource_path attribute for Grit resources
This is mandatory now upstream, otherwise the build will fail.

Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/aa0c216c0236a118e51e0e4f07c8ee48667c7004

commit aa0c216c0236a118e51e0e4f07c8ee48667c7004
Author: dpapad <dpapad@chromium.org>
Date:   Mon Feb 1 19:01:58 2021 +0000

    Grit: Force all generated files to specify a resource_path attribute.

     - Remove Grit logic to replace the gen folder with "@out_folder@"
       when generating GritResourceMap keys.
     - Instead add an assertion to ensure that generated files use
       |resource_path| to specify keys for the GritResourceMap.
       Note that the assertion is applied only in grd files that specify
       an output type of "resource_map_source".

    Also remove an alias in shared_resources_data_source.cc that was needed
    for android_clang_arm builds (see explanation at [1]). The workaround
    is no longer necessary as the files in question are added to grd files
    using generate_grd(), and they are leveraging |resource_path|, and not
    using the output folder location as GritResourceMap keys anymore.

    [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1020284#c45

    Fixed: 1171239
2021-03-23 14:55:07 -04:00
Terry Mancey efc1c1c1ea Fixes Brave ads appear underneath MacOS dock/menu bar and Windows taskbar 2021-03-10 07:44:19 +00:00
Terry Mancey fe95efe9fd Fixes Brave Ads crash when closing custom ad notification 2021-03-05 14:28:01 +00:00
mkarolin 1a9ffdab69 [Settings] fixes clicking 'Additional settings'.
Adds missing toolbar functions and removes no longer needed ones that we
removed from cr_toolbar.

Fixes brave/brave-browser#14065
2021-02-09 13:54:57 -05:00
bridiver fb3c0f5561 buildtools/checkdeps/checkdeps.py brave --extra-repos=brave runs succesfully 2021-02-06 13:34:00 -07:00
Terry Mancey 798b3ba1b5 Clang formatted Brave Ads and resolved linter issues 2021-02-06 10:11:20 +00:00
mkarolin 4fe94e11a3 Fixes formatting. 2021-02-04 23:52:49 -05:00
mkarolin 001962300f [WebUI] Fixes Settings left nav hidden state.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/0863a3b4baa1544826b7af95651723864e7679c9

commit 0863a3b4baa1544826b7af95651723864e7679c9
Author: John Lee <johntlee@chromium.org>
Date:   Tue Dec 15 19:18:36 2020 +0000

    Settings WebUI: Maintain focus on menus when changing screen size

    Fixed: 982173
2021-02-04 23:52:47 -05:00
mkarolin b1ac7b9a8c [WebUI] Adjusted rollup_plugin patch and our impl.
Chromium change:

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

commit b8cc59e15f318760e3992cd98cf5508b7796dd59
Author: rbpotter <rbpotter@chromium.org>
Date:   Tue Dec 22 01:33:14 2020 +0000

    optimize_webui: Support external_paths mapping argument

    - Refactor rollup plugin now that all chrome://resources files are
      read from the same folder to use a map and helper instead of
      duplicating logic for the Polymer and resources cases.
    - Add new external_paths argument to the rollup plugin, allowing URL
      prefixes to be mapped to directories.
    - Use this argument to pass the necessary mappings for resources and
      Polymer files to the plugin, instead of hardcoding the paths there
    - Allow the argument to also be extended by invokers, so that
      individual WebUIs can add their own mappings in addition to the
      defaults for chrome://resources and chrome://resources/polymer/v3_0.

    Bug: 1156829
2021-02-04 23:52:25 -05:00
ryanml 68a16f9fe6 Updating CW Icon in settings toolbar
Fixes brave/brave-browser#13770
2021-02-03 14:08:14 -07:00
Pete Miller a283a665b4 New Tab WebUI: dir=rtl via attribute
Targetable in css
2021-01-07 10:40:35 -08:00
mkarolin f6f6d30dc0 Formatting fixes. 2021-01-05 21:27:44 -05:00
mkarolin 0c2b58d195 [WebUI] Adjusted rollup override paths.
https://source.chromium.org/chromium/chromium/src/+/efc282784459e1ec69a524d901d8694cce5230c5

commit efc282784459e1ec69a524d901d8694cce5230c5
Author: rbpotter <rbpotter@chromium.org>
Date:   Tue Sep 1 04:37:15 2020 +0000

    Web UI: Add preprocessed resources and use in rollup

    Preprocess all shared JS module resources into:
    <root_gen_dir>/ui/webui/resources/webui_preprocessed

    and read all these resources from this directory when bundling with
    rollup.

    Bug: 1071641
2021-01-05 21:27:43 -05:00
mkarolin d2bf2c05dc ui/webui/resources/css/ resources grdp is now auto-generated.
Also, adjusted br_elements resource names to prevent collision with
cr_elements resource names.

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/456a8a60d47b523f9ff7b6c5d54ff051e7003963

commit 456a8a60d47b523f9ff7b6c5d54ff051e7003963
Author: dpapad <dpapad@chromium.org>
Date:   Thu Nov 12 06:42:27 2020 +0000

    WebUI: Auto-generate ui/webui/resources/css/ resources grdp file.

    Moving most IDR_WEBUI_CSS_* resources from webui_resources.grd to
    the auto-generated webui_generated_resources.grd.

    Resources that rely on flattenhtml=true are not affected, since
    |flattenhtml| is purposefully not supported by generate_grd().

    Bug: 1132403
2021-01-05 21:27:43 -05:00
mkarolin cd55dd8c67 Use views::PressedCallback instead of views::ButtonListener
Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/37cb433bb3d86231ee0c37cdd8a08f31ab35f172

commit 37cb433bb3d86231ee0c37cdd8a08f31ab35f172
Author: Peter Kasting <pkasting@chromium.org>
Date:   Thu Nov 5 23:22:51 2020 +0000

    Remove ButtonListener.

    Bug: 772945
2021-01-05 21:27:43 -05:00
mkarolin cf399406b6 Button::SetForcusForPlatform was removed.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/aa298022efdaaf3637faf741990ad311f5978cee

commit aa298022efdaaf3637faf741990ad311f5978cee
Author: Wei Li <weili@chromium.org>
Date:   Tue Oct 27 18:37:21 2020 +0000

    Remove SetFocusForPlatform() API

    SetFocusForPlatform() was used to override Button and its subclasses'
    focus behavior. Now the platform default focus behavior becomes Button's
    default setting. This API is no longer needed.

    Bug: 1001103
2020-12-08 15:26:53 -05:00
Terry Mancey ef8f8da9c7 Implement custom Brave Ad notifications 2020-11-21 21:26:36 +00:00
Mario Sanchez Prada 033fdeec00 Drop support for nonGeneratedFiles from brave_rollup_overrides.js
This made sense when Chromium's //c/b/resources/tools/rollup_plugin.js
considered that source JS files could come from both the sources and
the generated directories, but this is no longer the case as all those
JS files are under <root_gen_dir>/ui/webui/resources/webui_preprocessed
now, so we need to update Brave's code to adapt to this new scenario.

Chromium change:

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

commit efc282784459e1ec69a524d901d8694cce5230c5
Author: rbpotter <rbpotter@chromium.org>
Date:   Tue Sep 1 04:37:15 2020 +0000

    Web UI: Add preprocessed resources and use in rollup

    Preprocess all shared JS module resources into:
    <root_gen_dir>/ui/webui/resources/webui_preprocessed

    and read all these resources from this directory when bundling with
    rollup.

    Bug: 1071641
2020-10-28 13:59:42 -04:00
yan 8d8b4f1323 Remove non-locale uses of innerHTML
and add npm script to check for Trusted Type violations. locale strings
will be fixed in a separate PR.

fix https://github.com/brave/brave-browser/issues/11686
2020-09-16 10:13:13 -07:00
Pranjal Jumde 4317137ced Fix 3650: Enable google sign in for extensions 2020-08-19 09:10:20 -07:00
mkarolin 3a2358a735 Fixes WebUI rollup for brave resources.
Chromium change:

https://chromium.googlesource.com/chromium/src/+/315b3141c41dbdddb3d8b168cf7867b74df11904

commit 315b3141c41dbdddb3d8b168cf7867b74df11904
Author: Tommy Steimel <steimel@chromium.org>
Date:   Wed Jun 17 21:22:32 2020 +0000

    Make cr_elements available in chrome-untrusted:// frames

     - This CL makes updates polymer.py to always produce scheme-relative
    URLs when converting HTML imports that contain "chrome://" to JS
    imports.

    - This also changes optimize_webui.py and rollup_plugin.js to handle
    scheme-relative URLs.

    This allows chrome-untrusted:// frames using Polymer 3 to use
    cr_elements/ without hitting failures due to absolute
    chrome://resources URLs inside cr_elements/ imports.

    Bug: 1051835, 866236
2020-08-06 17:32:04 -04:00
Pete Miller e90fa9feb2 NTP WebUI: take global fonts and css out of JS bundle
Already served from chrome://brave-resource/... which will benefit from async parsing and cross-page caching
2020-07-07 15:41:59 -07:00
Pete Miller f375718c68 History WebUI: adjust selector to match chromium change for overidden button style 2020-07-01 18:12:05 -04:00
Pete Miller b5da570f70 WebUI: polymer_overrides ensures template modifications happen when modifications are registered after component definition
we cannot control the order in which modules are executed
2020-07-01 18:12:05 -04:00
Pete Miller bb2d1ff5cc WebUI: convert to polymer 3 and es modules
- Move everything to es-modules rather than html imports. There are a number of ways these can be generated: completely manual or automatic via `polymer_modulizer` or `js_modulizer`. Template html can then optionally be 'included' in to the JS file via `html_to_js`.
- With a single patch in to a module requested by all webui pages (web_ui_listener_behavior.js), brave's polymer_overriding.js can inject any neccessary global template modifications.
2020-07-01 18:12:05 -04:00
mkarolin 900e91b91b source_is_generated -> enable_input_discovery_for_gn_analyze.
Chromium change:

https://chromium.googlesource.com/chromium/src/+/6ade5dc4cb183b0f58cf9c1795fdfc6cba5e14bf

commit 6ade5dc4cb183b0f58cf9c1795fdfc6cba5e14bf
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Tue Mar 17 20:52:02 2020 +0000

    Rename source_is_generated -> enable_input_discovery_for_gn_analyze

    And update docs for the setting.

    Bug: 1054892
2020-05-26 09:52:28 -04:00
ryanml 1ace3ab56d Adding Opt-in WebUI for Crypto Wallets 2020-05-13 16:53:51 -04:00
ryanml b2c55c98e4 Adding MIT license for crypto-icons font 2020-04-22 20:01:09 -07:00
ryanml 5c2efc2fff Front end cleanup, price and ticker fixes 2020-04-09 00:41:13 -07:00
mkarolin 8813742653 Settings UI: use relative path for autoimport of CrSearchFieldBehavior.
chrome://resources/cr_elements/ is now redirected so a relative path
needs to be used to get import from {} statement generated.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/8afa59b8f3d39ca65c111e49b19475516f01c7a2

commit 8afa59b8f3d39ca65c111e49b19475516f01c7a2
Author: Demetrios Papadopoulos <dpapad@chromium.org>
Date:   Thu Jan 23 22:39:02 2020 +0000

    WebUI: Port cr_components/certificate_manager to Polymer3.

     - Add polymer_modulizer() and js_modulizer() rules as necessary to
       generate a Polymer3 version of certificate-manager at build time.
     - Remove unnecessary settings.Router references from tests.
     - Auto-generate tests for the Polymer3 version (and update Settings
       WebUI data source as needed)
     - Add a missing assertion in js_modulizer.py that was discovered.

    The Polymer3 version will be used by follow up CLs to migrate
    chrome://certificate-manager and eventually chrome://settings

    Bug: 1042558
2020-03-19 16:51:45 -04:00
mkarolin 2577713c11 Polymer 3 fixes for history page. 2020-03-19 16:51:41 -04:00