OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/input_method/component_extension_ime_manager_i
mpl.h" | 5 #include "chrome/browser/chromeos/input_method/component_extension_ime_manager_i
mpl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 return false; | 309 return false; |
310 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id)) | 310 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id)) |
311 return false; | 311 return false; |
312 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name)) | 312 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name)) |
313 return false; | 313 return false; |
314 | 314 |
315 // Localizes the input method name. | 315 // Localizes the input method name. |
316 if (out->display_name.find("__MSG_") == 0) { | 316 if (out->display_name.find("__MSG_") == 0) { |
317 const InputMethodNameMap* map = kInputMethodNameMap; | 317 const InputMethodNameMap* map = kInputMethodNameMap; |
318 size_t map_size = arraysize(kInputMethodNameMap); | 318 size_t map_size = arraysize(kInputMethodNameMap); |
319 std::string name = StringToUpperASCII(out->display_name); | 319 std::string name = base::StringToUpperASCII(out->display_name); |
320 const InputMethodNameMap map_key = {name.c_str(), 0}; | 320 const InputMethodNameMap map_key = {name.c_str(), 0}; |
321 const InputMethodNameMap* p = | 321 const InputMethodNameMap* p = |
322 std::lower_bound(map, map + map_size, map_key); | 322 std::lower_bound(map, map + map_size, map_key); |
323 if (p != map + map_size && name == p->message_name) | 323 if (p != map + map_size && name == p->message_name) |
324 out->display_name = l10n_util::GetStringUTF8(p->resource_id); | 324 out->display_name = l10n_util::GetStringUTF8(p->resource_id); |
325 } | 325 } |
326 DCHECK(out->display_name.find("__MSG_") == std::string::npos); | 326 DCHECK(out->display_name.find("__MSG_") == std::string::npos); |
327 | 327 |
328 std::set<std::string> languages; | 328 std::set<std::string> languages; |
329 const base::Value* language_value = NULL; | 329 const base::Value* language_value = NULL; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 453 |
454 ComponentExtensionEngine engine; | 454 ComponentExtensionEngine engine; |
455 ReadEngineComponent(component_ime, *dictionary, &engine); | 455 ReadEngineComponent(component_ime, *dictionary, &engine); |
456 component_ime.engines.push_back(engine); | 456 component_ime.engines.push_back(engine); |
457 } | 457 } |
458 out_imes->push_back(component_ime); | 458 out_imes->push_back(component_ime); |
459 } | 459 } |
460 } | 460 } |
461 | 461 |
462 } // namespace chromeos | 462 } // namespace chromeos |
OLD | NEW |