From 73978c989f87ac47bf3c824dd749bd57d617abf9 Mon Sep 17 00:00:00 2001 From: "rouslan@chromium.org" Date: Fri, 24 May 2013 06:33:12 +0000 Subject: [PATCH] Add IN_DICTIONARY feedback type for spelling service This CL adds a feedback type IN_DICTIONARY. Spellcheck will send this feedback when SpellingServiceClient returns a spellcheck result for a word that is in user's custom spellcheck dictionary. Upcoming CLs will address collecting and sending this type of feedback. BUG=170514 Review URL: https://chromiumcodereview.appspot.com/15934002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201982 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/spellchecker/spellcheck_action.cc | 4 ++++ chrome/browser/spellchecker/spellcheck_action.h | 3 +++ chrome/browser/spellchecker/spellcheck_action_unittest.cc | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/chrome/browser/spellchecker/spellcheck_action.cc b/chrome/browser/spellchecker/spellcheck_action.cc index dfba4411c33e..3373595719e3 100644 --- a/chrome/browser/spellchecker/spellcheck_action.cc +++ b/chrome/browser/spellchecker/spellcheck_action.cc @@ -19,6 +19,7 @@ SpellcheckAction::~SpellcheckAction() {} bool SpellcheckAction::IsFinal() const { return type == TYPE_ADD_TO_DICT || type == TYPE_IGNORE || + type == TYPE_IN_DICTIONARY || type == TYPE_MANUALLY_CORRECTED || type == TYPE_NO_ACTION || type == TYPE_SELECT; @@ -51,6 +52,9 @@ base::DictionaryValue* SpellcheckAction::Serialize() const { case TYPE_IGNORE: result->SetString("actionType", "IGNORE"); break; + case TYPE_IN_DICTIONARY: + result->SetString("actionType", "IN_DICTIONARY"); + break; case TYPE_NO_ACTION: result->SetString("actionType", "NO_ACTION"); break; diff --git a/chrome/browser/spellchecker/spellcheck_action.h b/chrome/browser/spellchecker/spellcheck_action.h index e687e047861c..c1b3cd2d11ff 100644 --- a/chrome/browser/spellchecker/spellcheck_action.h +++ b/chrome/browser/spellchecker/spellcheck_action.h @@ -23,6 +23,9 @@ class SpellcheckAction { // select any suggestions. The user cannot take any more actions on the // misspelling, because it has been deleted from the web page. TYPE_IGNORE, + // The misspelling is in user's custom spellcheck dictionary. The user will + // not see spellcheck suggestions for this misspelling. + TYPE_IN_DICTIONARY, // The user manually corrected the word to |value|. The user cannot take // more actions on this misspelling. TYPE_MANUALLY_CORRECTED, diff --git a/chrome/browser/spellchecker/spellcheck_action_unittest.cc b/chrome/browser/spellchecker/spellcheck_action_unittest.cc index c09d87bd6c54..f7d1b3041286 100644 --- a/chrome/browser/spellchecker/spellcheck_action_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_action_unittest.cc @@ -14,6 +14,7 @@ TEST(SpellcheckActionTest, FinalActionsTest) { static const SpellcheckAction::SpellcheckActionType kFinalActions[] = { SpellcheckAction::TYPE_ADD_TO_DICT, SpellcheckAction::TYPE_IGNORE, + SpellcheckAction::TYPE_IN_DICTIONARY, SpellcheckAction::TYPE_MANUALLY_CORRECTED, SpellcheckAction::TYPE_NO_ACTION, SpellcheckAction::TYPE_SELECT, @@ -61,6 +62,9 @@ TEST(SpellcheckActionTest, SerializeTest) { SpellcheckAction::TYPE_IGNORE, -1, ASCIIToUTF16("nothing")), "{\"actionType\": \"IGNORE\"}" }, { SpellcheckAction( + SpellcheckAction::TYPE_IN_DICTIONARY, -1, ASCIIToUTF16("nothing")), + "{\"actionType\": \"IN_DICTIONARY\"}" }, + { SpellcheckAction( SpellcheckAction::TYPE_MANUALLY_CORRECTED, -1, ASCIIToUTF16("hello")), "{\"actionTargetValue\": \"hello\"," "\"actionType\": \"MANUALLY_CORRECTED\"}" }, -- 2.11.4.GIT