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

Load magnet url instead of searching #903

Merged
merged 3 commits into from
Nov 20, 2018
Merged

Load magnet url instead of searching #903

merged 3 commits into from
Nov 20, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Nov 13, 2018

Fix brave/brave-browser#1435

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
  • 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:

yarn test brave_browser_tests --filter=BraveContentBrowserClientTest.TypedMagnetURL

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

@simonhong simonhong self-assigned this Nov 13, 2018
@simonhong simonhong requested review from bbondy and yrliou November 13, 2018 22:35
@@ -25,7 +25,8 @@ BraveAutocompleteSchemeClassifier::GetInputTypeForScheme(
return metrics::OmniboxInputType::INVALID;
}
if (base::IsStringASCII(scheme) &&
base::LowerCaseEqualsASCII(scheme, kBraveUIScheme)) {
(base::LowerCaseEqualsASCII(scheme, kBraveUIScheme) ||
base::LowerCaseEqualsASCII(scheme, kMagnetScheme))) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you check whether WebTorrent extension is enabled here, probably through ExtensionRegistry?
We could just use chromium's result when WebTorrent is disabled, and only change it when it is enabled, wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean IsWebtorrentEnabled(profile) && base::LowerCaseEqualsASCII(scheme, kMagnetScheme)?

Copy link
Member

Choose a reason for hiding this comment

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

right

Copy link
Member Author

@simonhong simonhong Nov 16, 2018

Choose a reason for hiding this comment

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

I'm trying to include content_browser_client_helper.h in this cc file but I got some compile error. Did you intend this header should be only included in brave_content_browser_client.cc?
I'm curious why you implemented all methods in header.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. IsWebtorrentEnabled() changed to api.

Copy link
Member

@yrliou yrliou left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@yrliou yrliou merged commit d2c5737 into master Nov 20, 2018
yrliou added a commit that referenced this pull request Nov 20, 2018
Load magnet url instead of searching
@yrliou
Copy link
Member

yrliou commented Nov 20, 2018

master: d2c5737
0.58.x: df2caae

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.

Pasting magnet link in URL does search instead of loading web torrent
3 participants