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

Side by Side Diff: trunk/src/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc

Issue 474483002: Revert 289312 "Move StringToUpperASCII and LowerCaseEqualsASCII ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return false; 313 return false;
314 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id)) 314 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id))
315 return false; 315 return false;
316 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name)) 316 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name))
317 return false; 317 return false;
318 318
319 // Localizes the input method name. 319 // Localizes the input method name.
320 if (out->display_name.find("__MSG_") == 0) { 320 if (out->display_name.find("__MSG_") == 0) {
321 const InputMethodNameMap* map = kInputMethodNameMap; 321 const InputMethodNameMap* map = kInputMethodNameMap;
322 size_t map_size = arraysize(kInputMethodNameMap); 322 size_t map_size = arraysize(kInputMethodNameMap);
323 std::string name = base::StringToUpperASCII(out->display_name); 323 std::string name = StringToUpperASCII(out->display_name);
324 const InputMethodNameMap map_key = {name.c_str(), 0}; 324 const InputMethodNameMap map_key = {name.c_str(), 0};
325 const InputMethodNameMap* p = 325 const InputMethodNameMap* p =
326 std::lower_bound(map, map + map_size, map_key); 326 std::lower_bound(map, map + map_size, map_key);
327 if (p != map + map_size && name == p->message_name) 327 if (p != map + map_size && name == p->message_name)
328 out->display_name = l10n_util::GetStringUTF8(p->resource_id); 328 out->display_name = l10n_util::GetStringUTF8(p->resource_id);
329 } 329 }
330 DCHECK(out->display_name.find("__MSG_") == std::string::npos); 330 DCHECK(out->display_name.find("__MSG_") == std::string::npos);
331 331
332 std::set<std::string> languages; 332 std::set<std::string> languages;
333 const base::Value* language_value = NULL; 333 const base::Value* language_value = NULL;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 457
458 ComponentExtensionEngine engine; 458 ComponentExtensionEngine engine;
459 ReadEngineComponent(component_ime, *dictionary, &engine); 459 ReadEngineComponent(component_ime, *dictionary, &engine);
460 component_ime.engines.push_back(engine); 460 component_ime.engines.push_back(engine);
461 } 461 }
462 out_imes->push_back(component_ime); 462 out_imes->push_back(component_ime);
463 } 463 }
464 } 464 }
465 465
466 } // namespace chromeos 466 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698