Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2653)

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 11412268: Add usage display support for Extension IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..48304083f93003995a29721f4a1ac124a439d7db 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,22 @@ bool SetCandidatesFunction::ReadCandidates(
&annotation));
}
+ if (candidate_dict->HasKey(keys::kUsageKey)) {
+ DictionaryValue* usage_dict;
+ EXTENSION_FUNCTION_VALIDATE(candidate_dict->GetDictionary(keys::kUsageKey,
+ &usage_dict));
+ 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;

Powered by Google App Engine
This is Rietveld 408576698