-
Notifications
You must be signed in to change notification settings - Fork 869
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
Add options for enable/disable autocomplete in omnibox #4033
Conversation
3bbc8ac
to
f823555
Compare
f823555
to
d4f76fc
Compare
@rebron Please check the sentence and position of this option. |
Looks like CI was disconnected during the test build for Win. Other platforms are finished. |
Took me a while to find the setting (under Appearance). Is there a better place for this? cc: @rebron |
I thought user could see this like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM! ++ (comment left for @rebron about location of this setting)
Verified it works good locally and CI passed on all platforms
@simonhong cc: @petemill |
d4f76fc
to
90bc428
Compare
@rebron Changed the sentence and position. see the newly captured image in description. |
Friendly ping to owner review @bridiver |
~OmniboxController() override; | ||
|
||
// The |current_url| field of input is only set for mobile ports. | ||
+ virtual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add virtual
using a chromium_src override
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I didn't know c++ allowsvirtual
keyword to appear both before and after the return type. 👍
Done. Thanks.
#define BRAVE_CHROMIUM_SRC_COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_CLIENT_H_ | ||
|
||
#define BRAVE_OMNIBOX_CLIENT_H \ | ||
virtual bool IsAutocompleteEnabled() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no point in making this a virtual method. We know the omnibox client is BraveOmniboxClient so just cast it in BraveOmniboxController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bridiver I think this causes layer violation because BraveOmniboxController
is in component layer but BraveOmniboxClient
is in chrome layer. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then make an abstract BraveOmniboxClient
with IsAutocompleteEnabled
in components and have BraveOmniboxClientImpl
in the chrome layer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then you can cast to BraveOmniboxClient
without a layering violation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bridiver Thanks for tips!
Updated and this PR doesn't have any new patch files :) PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
e35af85
to
e5461b7
Compare
e5461b7
to
986e353
Compare
When disabled, OmniboxController::StartAutocomplete() does early return instead of requesting to AutocompleteController.
… bar) kAutocompleteEnabledInAddressBar => kAutocompleteEnabled brave.autocomplete_enabled_in_address_bar => brave.autocomplete_enabled
BraveOmniboxClient has IsAutocompleteEnabled() method.
986e353
to
4e1b29f
Compare
When disabled, OmniboxController::StartAutocomplete() does early
return instead of requesting to AutocompleteController.
This option is disabled by default.
fix brave/brave-browser#843
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
yarn test brave_browser_tests --filter=OmniboxAutocompleteTest*
Manual test steps
Reviewer Checklist:
After-merge Checklist:
changes has landed on.