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

only use brave:// url for display purposes because chrome does some s… #2024

Merged
merged 2 commits into from
Mar 22, 2019

Conversation

bridiver
Copy link
Collaborator

@bridiver bridiver commented Mar 21, 2019

…ecurity checks based on the virtual url

fix brave/brave-browser#3411

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).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • 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.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

  1. Load chrome://version in the urlbar - should load version page and urlbar should display brave://version
  2. Load brave://settings in the urlbar - should load settings page
  3. search for sync in the settings page and click on the link for brave://sync - should load sync page

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

@bridiver bridiver self-assigned this Mar 21, 2019
@jasonrsadler
Copy link
Contributor

@bridiver Can you add test plan?

bbondy
bbondy previously approved these changes Mar 21, 2019
Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

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

May not be that big of a deal on a release build but on restart, opened brave:// tabs will show chrome:// momentarily before switching to page title.
Screen Shot 2019-03-21 at 12 10 43 PM

EXPECT_STREQ(url.c_str(),
base::UTF16ToUTF8(browser()->location_bar_model()
->GetFormattedFullURL()).c_str());
// EXPECT_EQ(url, active_contents()->GetVisibleURL());
Copy link
Contributor

Choose a reason for hiding this comment

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

remove if unneeded

GURL::Replacements replacements;
replacements.SetSchemeStr(kBraveUIScheme);
*url = url->ReplaceComponents(replacements);
if (HandleURLOverrideRewrite(url, browser_context))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit
brace surround the if.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You mean {}? That's only a JS lint issue, we generally don't use braces for one line in c++

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I usually include them anyway for readability. Wouldn't hold up an approval over it 🙂

@bridiver bridiver merged commit 9b9da18 into master Mar 22, 2019
@bridiver bridiver deleted the issues/3411 branch March 22, 2019 02:52
Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

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

++

bridiver added a commit that referenced this pull request Mar 22, 2019
only use brave:// url for display purposes because chrome does some s…
bridiver added a commit that referenced this pull request Mar 22, 2019
only use brave:// url for display purposes because chrome does some s…
bbondy added a commit that referenced this pull request Mar 25, 2019
bbondy added a commit that referenced this pull request Mar 25, 2019
@bsclifton bsclifton added this to the 0.64.x - Nightly milestone Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong location icon and page info bubble of brave page
6 participants