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

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

Issue 608183002: Move all white-listed input method indicator text from InputMethodUtil to manifests of IME extensio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revised per comments. Created 6 years, 2 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
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/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 DCHECK(out); 338 DCHECK(out);
339 std::string type; 339 std::string type;
340 if (!dict.GetString(extensions::manifest_keys::kType, &type)) 340 if (!dict.GetString(extensions::manifest_keys::kType, &type))
341 return false; 341 return false;
342 if (type != "ime") 342 if (type != "ime")
343 return false; 343 return false;
344 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id)) 344 if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id))
345 return false; 345 return false;
346 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name)) 346 if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name))
347 return false; 347 return false;
348 if (!dict.GetString(extensions::manifest_keys::kIndicator, &out->indicator))
349 out->indicator = "";
348 350
349 // Localizes the input method name. 351 // Localizes the input method name.
350 if (out->display_name.find("__MSG_") == 0) { 352 if (out->display_name.find("__MSG_") == 0) {
351 const InputMethodNameMap* map = kInputMethodNameMap; 353 const InputMethodNameMap* map = kInputMethodNameMap;
352 size_t map_size = arraysize(kInputMethodNameMap); 354 size_t map_size = arraysize(kInputMethodNameMap);
353 std::string name = StringToUpperASCII(out->display_name); 355 std::string name = StringToUpperASCII(out->display_name);
354 const InputMethodNameMap map_key = {name.c_str(), 0}; 356 const InputMethodNameMap map_key = {name.c_str(), 0};
355 const InputMethodNameMap* p = 357 const InputMethodNameMap* p =
356 std::lower_bound(map, map + map_size, map_key); 358 std::lower_bound(map, map + map_size, map_key);
357 if (p != map + map_size && name == p->message_name) 359 if (p != map + map_size && name == p->message_name)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 489
488 ComponentExtensionEngine engine; 490 ComponentExtensionEngine engine;
489 ReadEngineComponent(component_ime, *dictionary, &engine); 491 ReadEngineComponent(component_ime, *dictionary, &engine);
490 component_ime.engines.push_back(engine); 492 component_ime.engines.push_back(engine);
491 } 493 }
492 out_imes->push_back(component_ime); 494 out_imes->push_back(component_ime);
493 } 495 }
494 } 496 }
495 497
496 } // namespace chromeos 498 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_util.h » ('j') | chromeos/ime/input_method_descriptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698