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

Support alternate private search engine provider #310

Merged
merged 3 commits into from
Aug 10, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Aug 6, 2018

Use different TemplateURLService for normal and incognito mode to set default search engine provider independently.

Use duckduckgo as a default search engine provider in incognito mode.

kUseAlternatePrivateSearchEngine pref is introduced to toggle alternate search engine.
If it is set to false, incognito mode uses default search engine of normal mode.
Otherwise, duckduckgo is used as private mode default search engine.

Close brave/brave-browser#61

screen shot 2018-08-07 at 17 07 53

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:

yarn test brave_browser_tests --filter=AlternatePrivateSearchEngineTest.PrefTest

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@simonhong simonhong self-assigned this Aug 6, 2018
@simonhong simonhong force-pushed the support_alternate_private_search_engine branch 2 times, most recently from eb95ec2 to ccd4b93 Compare August 7, 2018 08:05
@simonhong simonhong requested a review from bbondy August 7, 2018 08:11
@simonhong simonhong changed the title WIP: Support alternate private search engine provider Support alternate private search engine provider Aug 7, 2018
@simonhong simonhong force-pushed the support_alternate_private_search_engine branch 2 times, most recently from 87ea963 to 446cf52 Compare August 8, 2018 07:24
@simonhong simonhong requested a review from cezaraugusto August 8, 2018 09:19
@simonhong simonhong force-pushed the support_alternate_private_search_engine branch from 446cf52 to d8f8922 Compare August 8, 2018 09:51
private_search_engine_data.SetShortName(base::ASCIIToUTF16("DuckDuckGo"));
private_search_engine_data.SetKeyword(base::ASCIIToUTF16("duckduckgo.com"));
private_search_engine_data.SetURL(
"https://duckduckgo.com/?q={searchTerms}&atb=v128-6_e");
Copy link
Member

Choose a reason for hiding this comment

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

I won't block on this but please fix in a follow up.
what is this for? &atb=v128-6_e
Please remove that and instead add the brave referral code of t=brave

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.

bbondy
bbondy previously approved these changes Aug 10, 2018
@bbondy
Copy link
Member

bbondy commented Aug 10, 2018

Please rebase and also fix the query parameter and then I'll re-approve and merge.

Use different TemplateURLService for normal and incognito mode to set
default search engine provider independently.

Use duckduckgo as a default search engine provider in incognito mode.

kUseAlternatePrivateSearchEngine pref is introduced to toggle alternate
search engine. If it is set to false, incognito mode uses default search
engine of normal mode.
Connect that button with kUseAlternatePrivateSearchEngine pref.
@simonhong simonhong force-pushed the support_alternate_private_search_engine branch from d8f8922 to 0bb0660 Compare August 10, 2018 04:55
@bbondy bbondy merged commit 181cfa9 into master Aug 10, 2018
@simonhong simonhong deleted the support_alternate_private_search_engine branch August 19, 2018 23:22
fmarier pushed a commit that referenced this pull request Oct 29, 2019
add uglifyjs-webpack-plugin as dep
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