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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.cc

Issue 606063002: Only strip 'keyboard' from the input method name for OOBE screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/chromeos/login/l10n_util.h" 5 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 29 matching lines...) Expand all
40 const char kSequenceToken[] = "chromeos_login_l10n_util"; 40 const char kSequenceToken[] = "chromeos_login_l10n_util";
41 41
42 scoped_ptr<base::DictionaryValue> CreateInputMethodsEntry( 42 scoped_ptr<base::DictionaryValue> CreateInputMethodsEntry(
43 const input_method::InputMethodDescriptor& method, 43 const input_method::InputMethodDescriptor& method,
44 const std::string selected) { 44 const std::string selected) {
45 input_method::InputMethodUtil* util = 45 input_method::InputMethodUtil* util =
46 input_method::InputMethodManager::Get()->GetInputMethodUtil(); 46 input_method::InputMethodManager::Get()->GetInputMethodUtil();
47 const std::string& ime_id = method.id(); 47 const std::string& ime_id = method.id();
48 scoped_ptr<base::DictionaryValue> input_method(new base::DictionaryValue); 48 scoped_ptr<base::DictionaryValue> input_method(new base::DictionaryValue);
49 input_method->SetString("value", ime_id); 49 input_method->SetString("value", ime_id);
50 input_method->SetString("title", util->GetInputMethodLongName(method)); 50 input_method->SetString(
51 "title", util->GetInputMethodLongNameStripped(method));
51 input_method->SetBoolean("selected", ime_id == selected); 52 input_method->SetBoolean("selected", ime_id == selected);
52 return input_method.Pass(); 53 return input_method.Pass();
53 } 54 }
54 55
55 // Returns true if element was inserted. 56 // Returns true if element was inserted.
56 bool InsertString(const std::string& str, std::set<std::string>* to) { 57 bool InsertString(const std::string& str, std::set<std::string>* to) {
57 const std::pair<std::set<std::string>::iterator, bool> result = 58 const std::pair<std::set<std::string>::iterator, bool> result =
58 to->insert(str); 59 to->insert(str);
59 return result.second; 60 return result.second;
60 } 61 }
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { 504 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() {
504 const input_method::InputMethodDescriptor current_input_method = 505 const input_method::InputMethodDescriptor current_input_method =
505 input_method::InputMethodManager::Get() 506 input_method::InputMethodManager::Get()
506 ->GetActiveIMEState() 507 ->GetActiveIMEState()
507 ->GetCurrentInputMethod(); 508 ->GetCurrentInputMethod();
508 return CreateInputMethodsEntry(current_input_method, 509 return CreateInputMethodsEntry(current_input_method,
509 current_input_method.id()); 510 current_input_method.id());
510 } 511 }
511 512
512 } // namespace chromeos 513 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698