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

Branding in settings and history pages #462

Merged
merged 2 commits into from
Jul 3, 2018
Merged

Conversation

yrliou
Copy link
Member

@yrliou yrliou commented Jul 1, 2018

Fix #212
Need to be merged together with brave/brave-core#212
Summary of this PR:

  • Add brave_page_visibility.js into chrome's settings_resources, and copy the js file into chrome's folder, so it could be processed and bundled together with other settings page html/js files in optimize_webui mode.
  • Add browser_resources so we could add flattenhtml="true" attribute into IDR_MD_HISTORY_SIDE_BAR_HTML, so the html would be preprocessed.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

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

@yrliou yrliou self-assigned this Jul 1, 2018
@yrliou yrliou changed the title [WIP] Branding in settings and history pages Branding in settings and history pages Jul 1, 2018
@yrliou yrliou requested a review from bbondy July 1, 2018 23:38
}).forEach(([sourcePath, destPath]) =>
fs.writeFileSync(destPath,
fs.readFileSync(sourcePath, 'utf8')
.replace(/<\?xml version="1.0" encoding="utf-8"\?>/i, '<?xml version="1.0" encoding="utf-8"?>\n' + autoGeneratedWarning)
.replace('<structure name="IDR_MD_EXTENSIONS_SIDEBAR_HTML"', '<structure name="IDR_MD_EXTENSIONS_SIDEBAR_HTML" preprocess="true"')
.replace('<structure name="IDR_SETTINGS_APPEARANCE_FONTS_PAGE_HTML"', '<structure name="IDR_SETTINGS_APPEARANCE_FONTS_PAGE_HTML" preprocess="true"')
.replace('<structure name="IDR_SETTINGS_PASSWORDS_SECTION_HTML"', '<structure name="IDR_SETTINGS_PASSWORDS_SECTION_HTML" preprocess="true"')
.replace('<include name="IDR_MD_HISTORY_SIDE_BAR_HTML"', '<include name="IDR_MD_HISTORY_SIDE_BAR_HTML" flattenhtml="true"')
.replace(pageVisibility, bravePageVisibility + pageVisibility)
Copy link
Member

Choose a reason for hiding this comment

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

It occurred to me that we should probably throw an error if the expected number of replacements doesn't match exactly with the number of replacements. In this case 1.
I posted this Backlog issue for that:
#475

@yrliou yrliou merged commit 1b61377 into master Jul 3, 2018
@yrliou yrliou deleted the branding_settings_history branch July 3, 2018 16:23
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.

2 participants