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

Issue 2764001: Sort input methods names in the language selector by language names. (Closed)

Created:
10 years, 6 months ago by Yusuke Sato
Modified:
9 years, 7 months ago
Reviewers:
satorux1
CC:
chromium-os-reviews_chromium.org, davemoore+watch_chromium.org, ben+cc_chromium.org, Zachary Kuznia, mazda
Visibility:
Public.

Description

Sort input methods names in the language selector by language names. BUG=chromium-os:3867 TEST=manual. ran the unit_test as well. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=49367

Patch Set 1 #

Patch Set 2 : for review #

Total comments: 12

Patch Set 3 : fixed all #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -7 lines) Patch
M chrome/browser/chromeos/options/language_config_view.h View 1 2 1 chunk +7 lines, -1 line 0 comments Download
M chrome/browser/chromeos/options/language_config_view.cc View 1 2 4 chunks +59 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/options/language_config_view_test.cc View 1 2 3 chunks +51 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Yusuke Sato
10 years, 6 months ago (2010-06-08 08:54:38 UTC) #1
satorux1
http://codereview.chromium.org/2764001/diff/2001/3001 File chrome/browser/chromeos/options/language_config_view.cc (right): http://codereview.chromium.org/2764001/diff/2001/3001#newcode981 chrome/browser/chromeos/options/language_config_view.cc:981: language_code_1 = id_to_language_code_map_.find(s1)->second; You are looking up the map ...
10 years, 6 months ago (2010-06-09 04:27:06 UTC) #2
Yusuke Sato
Thanks for the comment. Fixed all and checked unit_test passes. http://codereview.chromium.org/2764001/diff/2001/3001 File chrome/browser/chromeos/options/language_config_view.cc (right): http://codereview.chromium.org/2764001/diff/2001/3001#newcode981 ...
10 years, 6 months ago (2010-06-09 09:20:50 UTC) #3
satorux1
10 years, 6 months ago (2010-06-09 09:42:37 UTC) #4
LGTM

On 2010/06/09 09:20:50, Yusuke Sato wrote:
> Thanks for the comment. Fixed all and checked unit_test passes.
> 
> http://codereview.chromium.org/2764001/diff/2001/3001
> File chrome/browser/chromeos/options/language_config_view.cc (right):
> 
> http://codereview.chromium.org/2764001/diff/2001/3001#newcode981
> chrome/browser/chromeos/options/language_config_view.cc:981: language_code_1 =
> id_to_language_code_map_.find(s1)->second;
> On 2010/06/09 04:27:07, satorux1 wrote:
> > You are looking up the map twice here. 
> 
> Done.
> 
> http://codereview.chromium.org/2764001/diff/2001/3001#newcode989
> chrome/browser/chromeos/options/language_config_view.cc:989: return s1 < s2; 
//
> use an input method id as the second sort key.
> On 2010/06/09 04:27:07, satorux1 wrote:
> > This worries me. STL sort() can crash if the given comparator does not meet
> > certain conditions. I'm not sure if this meets the conditions.
> > 
> > I guess you can get rid of the "if" block.
> 
> Done.
> 
> Instead of comparing s1 and s2, I used std::stable_sort in
> SortInputMethodIdsByNames() so that the function maintains the order of input
> method ids that belong to the same language (e.g. "mozc" and "xkb:jp::jpn").
> 
> Please check the comment in SetInputMethodActivated() too.
> 
> http://codereview.chromium.org/2764001/diff/2001/3003
> File chrome/browser/chromeos/options/language_config_view_test.cc (right):
> 
> http://codereview.chromium.org/2764001/diff/2001/3003#newcode32
> chrome/browser/chromeos/options/language_config_view_test.cc:32:
> LanguageConfigView::SortLanguageCodesByNames(&language_codes);  // do nothing
> On 2010/06/09 04:27:07, satorux1 wrote:
> > Maybe a bit more descriptive comment is useful.
> > 
> > // Check if this function can handle an empty list.
> 
> Done.
> 
> http://codereview.chromium.org/2764001/diff/2001/3003#newcode55
> chrome/browser/chromeos/options/language_config_view_test.cc:55:
> LanguageConfigView::SortInputMethodIdsByNames(&input_method_ids);
> On 2010/06/09 04:27:07, satorux1 wrote:
> > ditto.
> 
> Done.
> 
> http://codereview.chromium.org/2764001/diff/2001/3003#newcode59
> chrome/browser/chromeos/options/language_config_view_test.cc:59:
> input_method_ids.push_back("m17n:latn-pre");  // language code is "t"
> On 2010/06/09 04:27:07, satorux1 wrote:
> > We'll sort by language names, not codes. Would be nice to have language
names
> in
> > the comments like
> > 
> > // ja => Japanese
> 
> Done.
> 
> http://codereview.chromium.org/2764001/diff/2001/3003#newcode64
> chrome/browser/chromeos/options/language_config_view_test.cc:64:
> ASSERT_EQ("m17n:latn-pre",  input_method_ids[2]);  // "t"
> On 2010/06/09 04:27:07, satorux1 wrote:
> > Ditto.
> 
> Done.

Powered by Google App Engine
This is Rietveld 408576698