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

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

Issue 389913002: Moving IME manifests to chrome resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/input_method_util.h" 5 #include "chrome/browser/chromeos/input_method/input_method_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 }; 238 };
239 const size_t kEnglishToResourceIdArraySize = 239 const size_t kEnglishToResourceIdArraySize =
240 arraysize(kEnglishToResourceIdArray); 240 arraysize(kEnglishToResourceIdArray);
241 241
242 } // namespace 242 } // namespace
243 243
244 namespace chromeos { 244 namespace chromeos {
245 245
246 namespace input_method { 246 namespace input_method {
247 247
248 InputMethodUtil::InputMethodUtil( 248 InputMethodUtil::InputMethodUtil(InputMethodDelegate* delegate)
249 InputMethodDelegate* delegate,
250 scoped_ptr<InputMethodDescriptors> supported_input_methods)
251 : delegate_(delegate) { 249 : delegate_(delegate) {
252 // Makes sure the supported input methods at least have the fallback ime. 250 InputMethodDescriptors default_input_methods;
253 // So that it won't cause massive test failures. 251 default_input_methods.push_back(GetFallbackInputMethodDescriptor());
254 if (supported_input_methods->empty()) 252 ResetInputMethods(default_input_methods);
255 supported_input_methods->push_back(GetFallbackInputMethodDescriptor());
256
257 ResetInputMethods(*supported_input_methods);
258 253
259 // Initialize a map from English string to Chrome string resource ID as well. 254 // Initialize a map from English string to Chrome string resource ID as well.
260 for (size_t i = 0; i < kEnglishToResourceIdArraySize; ++i) { 255 for (size_t i = 0; i < kEnglishToResourceIdArraySize; ++i) {
261 const EnglishToResouceId& map_entry = kEnglishToResourceIdArray[i]; 256 const EnglishToResouceId& map_entry = kEnglishToResourceIdArray[i];
262 const bool result = english_to_resource_id_.insert(std::make_pair( 257 const bool result = english_to_resource_id_.insert(std::make_pair(
263 map_entry.english_string_from_ibus, map_entry.resource_id)).second; 258 map_entry.english_string_from_ibus, map_entry.resource_id)).second;
264 DCHECK(result) << "Duplicated string is found: " 259 DCHECK(result) << "Duplicated string is found: "
265 << map_entry.english_string_from_ibus; 260 << map_entry.english_string_from_ibus;
266 } 261 }
267 262
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 "US", 703 "US",
709 layouts, 704 layouts,
710 languages, 705 languages,
711 true, // login keyboard. 706 true, // login keyboard.
712 GURL(), // options page, not available. 707 GURL(), // options page, not available.
713 GURL()); // input view page, not available. 708 GURL()); // input view page, not available.
714 } 709 }
715 710
716 } // namespace input_method 711 } // namespace input_method
717 } // namespace chromeos 712 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698