Chromium Code Reviews| Index: chrome/browser/extensions/api/input_ime/input_ime_api.cc |
| diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc |
| index 4a35c31a1e374950f48f56a1ff4e8c910897ef0f..92f726335ec54f8e6cd2b99a5a58905afd949b9f 100644 |
| --- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc |
| +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc |
| @@ -661,6 +661,7 @@ bool SetCandidatesFunction::ReadCandidates( |
| int id; |
| std::string label; |
| std::string annotation; |
| + chromeos::InputMethodEngine::UsageEntry usage_entry; |
| EXTENSION_FUNCTION_VALIDATE(candidate_dict->GetString(keys::kCandidateKey, |
| &candidate)); |
| @@ -676,11 +677,25 @@ bool SetCandidatesFunction::ReadCandidates( |
| &annotation)); |
| } |
| + if (candidate_dict->HasKey(keys::kUsageKey)) { |
| + DictionaryValue* usage_dict; |
| + EXTENSION_FUNCTION_VALIDATE(candidate_dict->GetDictionary(keys::kUsageKey, |
| + &usage_dict)); |
| + if (usage_dict->HasKey(keys::kUsageTitleKey) && |
| + usage_dict->HasKey(keys::kUsageBodyKey)) { |
|
Matt Perry
2012/11/30 20:38:08
Looking at the json, "title" and "body" are not op
Seigo Nonaka
2012/12/01 15:31:18
Done.
|
| + EXTENSION_FUNCTION_VALIDATE(usage_dict->GetString(keys::kUsageTitleKey, |
| + &usage_entry.title)); |
| + EXTENSION_FUNCTION_VALIDATE(usage_dict->GetString(keys::kUsageBodyKey, |
| + &usage_entry.body)); |
| + } |
| + } |
| + |
| output->push_back(chromeos::InputMethodEngine::Candidate()); |
| output->back().value = candidate; |
| output->back().id = id; |
| output->back().label = label; |
| output->back().annotation = annotation; |
| + output->back().usage = usage_entry; |
| if (candidate_dict->HasKey(keys::kCandidatesKey)) { |
| ListValue* sub_list; |