Skip to content
This repository has been archived by the owner. It is now read-only.

Deprecate electron spellchecker by chromium's #244

Merged
merged 1 commit into from Jul 12, 2017
Merged

Deprecate electron spellchecker by chromium's #244

merged 1 commit into from Jul 12, 2017

Conversation

@darkdh
Copy link
Member

darkdh commented Jul 11, 2017

@darkdh darkdh requested review from bridiver, bbondy and bsclifton Jul 11, 2017
@darkdh darkdh force-pushed the spellchecker branch from ed81eb2 to 8601dc7 Jul 11, 2017
@darkdh darkdh mentioned this pull request Jul 11, 2017
7 of 8 tasks complete
@darkdh darkdh self-assigned this Jul 11, 2017
@darkdh darkdh added the branch-4.3.x label Jul 11, 2017
@darkdh darkdh added this to the 4.3.2 milestone Jul 11, 2017
if (spellcheck) {
if (spellcheck->GetCustomDictionary()
->HasWord(base::UTF16ToUTF8(new_params.selection_text))) {
new_params.misspelled_word =

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

I'm not sure I understand what is happening here

This comment has been minimized.

Copy link
@darkdh

darkdh Jul 11, 2017

Author Member

It is used for https://github.com/brave/browser-laptop/pull/9951/files#diff-b9f459fd47114771333b78b87fac7daaR557 which provides user an option to remove added word to custom dictionary.
because if a word is in custom dictionary, we can't tell if it is correctly spelled word or in custom dictionary from ContextMenuParams. misspelled_word and dictionary_suggestions will be empty

This comment has been minimized.

Copy link
@darkdh

darkdh Jul 11, 2017

Author Member

per discussion on slack, we should use ContextMenuParams.properties

@@ -971,6 +989,50 @@ void WebContents::AuthorizePlugin(mate::Arguments* args) {
web_contents(), true, resource_id);
}

void WebContents::AddWord(mate::Arguments* args) {

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

the spellcheck service is associated with the browser context, not the webcontents so this should probably be an api attached to session like autofill

This comment has been minimized.

Copy link
@darkdh

darkdh Jul 11, 2017

Author Member

will do. and this will helps for migrating old words in legacy custom dictionary.

if (SpellCheckProvider* provider =
SpellCheckProvider::Get(render_view->GetMainRenderFrame()))
provider->EnableSpellcheck(spellcheck_->IsSpellcheckEnabled());
new SpellCheckPanel(render_view);

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

shouldn't this be wrapped in #if BUILDFLAG(HAS_SPELLCHECK_PANEL) ?

This comment has been minimized.

Copy link
@darkdh

darkdh Jul 11, 2017

Author Member

yes, we should. because I was working based on cr59 and this is added in cr60.
When I pushed the commit, I just rebase the muon for our cr60 commits

Emit("context-menu", std::make_pair(params, web_contents()));
// For forgetting custom dictionary option
content::ContextMenuParams new_params(params);
if (new_params.misspelled_word.empty()) {

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

we should also check to make sure selection_text is not empty

@darkdh
Copy link
Member Author

darkdh commented Jul 11, 2017

@bridiver feedback addressed!

Copy link
Collaborator

bridiver left a comment

++ with a few small changes

if (spellcheck->GetCustomDictionary()->HasWord(selection_text)) {
new_params.properties.insert(
std::pair<std::string, std::string>
(std::string("learnedSpelling"), selection_text));

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

maybe "customDictionaryWord"?

@@ -71,36 +67,9 @@ WebFrameBindings::~WebFrameBindings() {
}

void WebFrameBindings::Invalidate() {

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

we should remove this method override

Emit("context-menu", std::make_pair(params, web_contents()));
// For forgetting custom dictionary option
content::ContextMenuParams new_params(params);
if (new_params.misspelled_word.empty() &&

This comment has been minimized.

Copy link
@bridiver

bridiver Jul 11, 2017

Collaborator

actually we should also check is_editable and spellcheck_enabled because spellcheck only applies to editable fields. Just want to narrow this check to run as infrequently as possible

@darkdh
Copy link
Member Author

darkdh commented Jul 12, 2017

@bridiver if 3abf627 looks good to you, I will squash the commits

@bridiver
Copy link
Collaborator

bridiver commented Jul 12, 2017

lgtm. Just want to verify that this is targeted to browser-laptop 0.18? If not please update the milestone to 4.4.0

@bridiver bridiver removed the branch-4.3.x label Jul 12, 2017
@bridiver bridiver modified the milestones: 4.4.0, 4.3.2 Jul 12, 2017
@darkdh darkdh force-pushed the spellchecker branch from 3abf627 to 58259a9 Jul 12, 2017
@darkdh
Copy link
Member Author

darkdh commented Jul 12, 2017

my bad.it should be in 4.4.0

@darkdh darkdh force-pushed the spellchecker branch from 58259a9 to 8b88fc6 Jul 12, 2017
@bridiver bridiver merged commit 1fd2962 into master Jul 12, 2017
@bsclifton bsclifton deleted the spellchecker branch Jul 13, 2017
@darkdh darkdh added the branch-4.4.x label Jul 13, 2017
bridiver added a commit that referenced this pull request Jul 18, 2017
Deprecate electron spellchecker by chromium's
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.