Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cr84] Settings page follow-ups: fixes guest mode, and refactors to overrides by module name #5976

Merged
merged 4 commits into from
Jun 30, 2020

Conversation

petemill
Copy link
Member

@petemill petemill commented Jun 30, 2020

  • Fix settings page in guest mode windows, use and override page visibility correctly
  • Brings back the row divider lines for brave items.
  • Refactor all settings webui overrides to be in modules with the name of the overriden component, as per the new README.md:
Use this directory to add modifications to any chromium polymer module.
Steps to take:
- Create a JS module which calls any of the polymer_overriding exported functions, e.g. `RegisterStyleOverride`.
- Import the module to the index.js inside this directory.
- Include the module in settings_resources.grd.

Fix brave/brave-browser#5065
Fix brave/brave-browser#2995

image

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@petemill petemill self-assigned this Jun 30, 2020
@petemill petemill changed the title [cr84] Settings page fixes guest mode, and refactors to overrides by module name [cr84] Settings page follow-ups: fixes guest mode, and refactors to overrides by module name Jun 30, 2020
@petemill petemill requested a review from bridiver as a code owner June 30, 2020 06:16
@petemill
Copy link
Member Author

might want to review commit by commit because the refactor commit confuses things due to moved files

@bsclifton
Copy link
Member

Wow - I think I'll need to review the changes in Chromium 84 first... because that code changed quite a bit. This cleans it up even more; love it 😄 Will circle back after checking out C84

@petemill
Copy link
Member Author

@bsclifton yes I did this refactor a bit iteratively:

  • With the essential cr84 PR, I moved all the style definitions to component-specific JS files in style_overrides directory (through neccessity of having to remove the previous .html files), and made the API more declarative (RegisterStyleOverride vs the previous component naming convention brave-style-override-component-name).

  • With this PR, I grouped all the overrides for a specific component (template, style, or behavior) so they are defined in the same place. Much easier to see what we're changing per-component as a whole. On reflection of what I did last week to get cr84 running, I decided this was the way I wanted to leave the cr84 conversion now that it's all JS.

Now that everything is defined in JS (with the move to es-modules), we can more declaratively define the overrides. This gives us an opportunity to make the overrides more readable, maintainable and expressed in the expected file name or the overridden component.
Use and override page visibility correctly
Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@mkarolin mkarolin merged commit 7359821 into cr84 Jun 30, 2020
@mkarolin mkarolin deleted the cr84-settings-refactor branch June 30, 2020 22:27
@mkarolin mkarolin restored the cr84-settings-refactor branch June 30, 2020 23:03
@bsclifton bsclifton added this to the 1.11.x - Release milestone Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants