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

Unified Diff: chrome/common/extensions/api/input_ime/input_components_handler.cc

Issue 14772016: Treats empty layout as expected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comment Created 7 years, 7 months 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/input_ime/input_components_handler.cc
diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.cc b/chrome/common/extensions/api/input_ime/input_components_handler.cc
index 36da8bb044fb59d3bc21ac8bdd09bb7d9f356b81..fbead8971bbb93e2ac2e081542a0e8a16f069399 100644
--- a/chrome/common/extensions/api/input_ime/input_components_handler.cc
+++ b/chrome/common/extensions/api/input_ime/input_components_handler.cc
@@ -117,21 +117,17 @@ bool InputComponentsHandler::Parse(Extension* extension,
// Get input_components[i].layouts.
const ListValue* layouts_value = NULL;
- if (!module_value->GetList(keys::kLayouts, &layouts_value)) {
- *error = ASCIIToUTF16(
- errors::kInvalidInputComponentLayouts);
- return false;
- }
-
- for (size_t j = 0; j < layouts_value->GetSize(); ++j) {
- std::string layout_name_str;
- if (!layouts_value->GetString(j, &layout_name_str)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidInputComponentLayoutName,
- base::IntToString(i), base::IntToString(j));
- return false;
+ if (module_value->GetList(keys::kLayouts, &layouts_value)) {
+ for (size_t j = 0; j < layouts_value->GetSize(); ++j) {
+ std::string layout_name_str;
+ if (!layouts_value->GetString(j, &layout_name_str)) {
+ *error = ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidInputComponentLayoutName,
+ base::IntToString(i), base::IntToString(j));
+ return false;
+ }
+ layouts.insert(layout_name_str);
}
- layouts.insert(layout_name_str);
}
if (module_value->HasKey(keys::kShortcutKey)) {
« no previous file with comments | « no previous file | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698