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 312023002: Sync starting language and input method preferences (Closed)

Created:
6 years, 6 months ago by michaelpg
Modified:
6 years ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, oshima+watch_chromium.org, plundblad+watch_chromium.org, yukishiino+watch_chromium.org, aboxhall+watch_chromium.org, arv+watch_chromium.org, yuzo+watch_chromium.org, nona+watch_chromium.org, yusukes+watch_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, nkostylev+watch_chromium.org, Seigo Nonaka, Nikita (slow)
Visibility:
Public.

Description

Sync starting language and input method preferences Users who use additional Chromebooks or who recreate their accounts have to manually set up their preferred languages, input methods and IMEs on each device, because only the locale (display language) syncs. We don't forcibly keep these settings in sync because different machines may use different built-in or peripheral keyboards. But we can make the set-up process smoother if we know what settings the user chose most recently. This CL creates syncable of the language and input methods preferences, so the server always has the latest changes. When, and only when, a user logs in and syncs for the first time on a device, we take the local variants the user has already chosen for this machine, and we add to them the global variants that come down from sync. This only happens at most once. It should only be additive, not remove any chosen settings. Some caveats: * If the user makes a change to one language/input setting, sync all three interdependent settings so the sync server's settings are always internally consistent. BUG=298345 R=nkostylev@chromium.org, yukishiino@chromium.org, hajimehoshi@chromium.org CC=nona@chromium.org Committed: https://crrev.com/cceac6fae685fd86d6f347d6712886549e372231 Cr-Commit-Position: refs/heads/master@{#306164} Committed: https://crrev.com/975f2189e0e36e367a2fc0c7147373e34f3ffc46 Cr-Commit-Position: refs/heads/master@{#306976}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Use original local preferences. #

Patch Set 3 : Changes in progress, probably broken... #

Total comments: 2

Patch Set 4 : Validation and updates for tests. #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 7

Patch Set 7 : #

Total comments: 15

Patch Set 8 : rebase and dzhioev's comments #

Total comments: 4

Patch Set 9 : Refactored for xkb refactor #

Total comments: 19

Patch Set 10 : Address comments, move InputMethodSyncer to new file #

Patch Set 11 : rebase #

Patch Set 12 : fix test, rebase #

Patch Set 13 : fix more tests? #

Patch Set 14 : rebase #

Total comments: 2

Patch Set 15 : fix null pointer dereference #

Patch Set 16 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1123 lines, -53 lines) Patch
A chrome/browser/chromeos/input_method/input_method_syncer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +92 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/input_method/input_method_syncer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +328 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/session/user_session_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/session/user_session_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +10 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/users/fake_user_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/preferences.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/preferences.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +17 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/preferences_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +646 lines, -38 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +12 lines, -1 line 0 comments Download

Messages

Total messages: 72 (13 generated)
michaelpg
Please take a look and let me know if you want to recommend other reviewers ...
6 years, 6 months ago (2014-06-04 01:12:02 UTC) #1
Nikita (slow)
+alemate@ +shuchen@
6 years, 6 months ago (2014-06-04 04:12:51 UTC) #2
hajimehoshi
https://codereview.chromium.org/312023002/diff/20001/chrome/browser/resources/options/language_list.js File chrome/browser/resources/options/language_list.js (right): https://codereview.chromium.org/312023002/diff/20001/chrome/browser/resources/options/language_list.js#newcode104 chrome/browser/resources/options/language_list.js:104: preferredLanguagesPref: 'settings.language.preferred_languages_local', On 2014/06/04 01:12:02, Michael Giuffrida wrote: > ...
6 years, 6 months ago (2014-06-04 05:55:01 UTC) #3
hajimehoshi
CC +kenjibaheux
6 years, 6 months ago (2014-06-04 06:05:36 UTC) #4
kenjibaheux
On 2014/06/04 06:05:36, hajimehoshi wrote: > CC +kenjibaheux Note: the list of languages and some ...
6 years, 6 months ago (2014-06-04 06:23:28 UTC) #5
michaelpg
On 2014/06/04 06:23:28, kenjibaheux wrote: > On 2014/06/04 06:05:36, hajimehoshi wrote: > > CC +kenjibaheux ...
6 years, 6 months ago (2014-06-04 06:55:57 UTC) #6
Alexander Alekseev
https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc#newcode260 chrome/browser/chromeos/preferences.cc:260: prefs::kLanguagePreferredLanguagesLocal, I think it is dangerous to change meaning ...
6 years, 6 months ago (2014-06-04 14:20:56 UTC) #7
Alexander Alekseev
https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc#newcode456 chrome/browser/chromeos/preferences.cc:456: preload_engines_local_.SetValue(preload_engines_.GetValue()); The same as my comment below: the list ...
6 years, 6 months ago (2014-06-04 14:23:55 UTC) #8
Shu Chen
One concern is you may need to make sure the input method IDs in prefs ...
6 years, 6 months ago (2014-06-04 14:35:11 UTC) #9
michaelpg
On 2014/06/04 14:35:11, Shu Chen wrote: > One concern is you may need to make ...
6 years, 6 months ago (2014-06-04 22:48:34 UTC) #10
michaelpg
On 2014/06/04 14:20:56, alemate wrote: > https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc > File chrome/browser/chromeos/preferences.cc (right): > > https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc#newcode260 > ...
6 years, 6 months ago (2014-06-04 22:50:55 UTC) #11
Alexander Alekseev
> https://codereview.chromium.org/312023002/diff/20001/chrome/browser/chromeos/preferences.cc#newcode458 > > chrome/browser/chromeos/preferences.cc:458: > enabled_extension_imes_.GetValue()); > > This is dangerous, as you do ...
6 years, 6 months ago (2014-06-05 12:16:22 UTC) #12
Shu Chen
https://codereview.chromium.org/312023002/diff/60001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/60001/chrome/browser/chromeos/preferences.cc#newcode789 chrome/browser/chromeos/preferences.cc:789: extension_ime_util::MaybeGetLegacyXkbId); extension_ime_util::MaybeGetLegacyXkbId to get engine id specifically for XKB ...
6 years, 6 months ago (2014-06-11 03:54:56 UTC) #13
michaelpg
On 2014/06/11 03:54:56, Shu Chen wrote: > https://codereview.chromium.org/312023002/diff/60001/chrome/browser/chromeos/preferences.cc > File chrome/browser/chromeos/preferences.cc (right): > > https://codereview.chromium.org/312023002/diff/60001/chrome/browser/chromeos/preferences.cc#newcode789 ...
6 years, 6 months ago (2014-06-13 20:21:15 UTC) #14
Shu Chen
On 2014/06/13 20:21:15, Michael Giuffrida wrote: > On 2014/06/11 03:54:56, Shu Chen wrote: > > ...
6 years, 6 months ago (2014-06-14 01:18:43 UTC) #15
michaelpg
OK, I've made some updates to the syncing logic to check the languages, preload engines ...
6 years, 5 months ago (2014-06-28 05:25:29 UTC) #16
Alexander Alekseev
https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc#newcode139 chrome/browser/chromeos/preferences.cc:139: if (component_extension_manager->IsInitialized()) { This seems to be dangerous (what ...
6 years, 5 months ago (2014-06-30 21:22:24 UTC) #17
Shu Chen
https://codereview.chromium.org/312023002/diff/140001/chromeos/ime/extension_ime_util.cc File chromeos/ime/extension_ime_util.cc (right): https://codereview.chromium.org/312023002/diff/140001/chromeos/ime/extension_ime_util.cc#newcode116 chromeos/ime/extension_ime_util.cc:116: just do: return input_method_id.substr(kComponentExtensionIMEPrefixLength + kExtensionIdLength); https://codereview.chromium.org/312023002/diff/140001/chromeos/ime/extension_ime_util.h File chromeos/ime/extension_ime_util.h ...
6 years, 5 months ago (2014-07-02 02:29:04 UTC) #18
michaelpg
https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc#newcode139 chrome/browser/chromeos/preferences.cc:139: if (component_extension_manager->IsInitialized()) { On 2014/06/30 21:22:23, alemate wrote: > ...
6 years, 5 months ago (2014-07-10 00:46:02 UTC) #19
Shu Chen
lgtm for ime related changes. I'm not owner for chromeos/ime/..., so you may want to ...
6 years, 5 months ago (2014-07-10 01:17:07 UTC) #20
michaelpg
Thanks, I've added yukishiino@ for chromeos/ime.
6 years, 5 months ago (2014-07-10 02:54:35 UTC) #21
Yuki
lgtm for chromeos/ime/
6 years, 5 months ago (2014-07-10 03:46:15 UTC) #22
Alexander Alekseev
lgtm https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/140001/chrome/browser/chromeos/preferences.cc#newcode139 chrome/browser/chromeos/preferences.cc:139: if (component_extension_manager->IsInitialized()) { On 2014/07/10 00:46:01, Michael Giuffrida ...
6 years, 5 months ago (2014-07-10 17:47:49 UTC) #23
michaelpg
Thanks all. Nikita, does this LGTY?
6 years, 5 months ago (2014-07-21 19:43:50 UTC) #24
Nikita (slow)
I'm delegating my review to Pavel since he was working on making Chrome OS preferences ...
6 years, 5 months ago (2014-07-23 10:38:38 UTC) #25
dzhioev (left Google)
https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode109 chrome/browser/chromeos/login/session/user_session_manager.cc:109: prefs->SetBoolean(prefs::kLanguageShouldMergeInputMethods, true); On 2014/07/10 00:46:02, michaelpg wrote: > This ...
6 years, 5 months ago (2014-07-23 11:02:20 UTC) #26
dzhioev (left Google)
https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode109 chrome/browser/chromeos/login/session/user_session_manager.cc:109: prefs->SetBoolean(prefs::kLanguageShouldMergeInputMethods, true); On 2014/07/23 11:02:20, dzhioev wrote: > On ...
6 years, 5 months ago (2014-07-23 11:06:50 UTC) #27
dzhioev (left Google)
https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode106 chrome/browser/chromeos/login/session/user_session_manager.cc:106: language_preferred_languages.SetValue(JoinString(language_codes, ',')); Could you please replace these 3 lines ...
6 years, 5 months ago (2014-07-24 20:31:34 UTC) #28
michaelpg
https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode106 chrome/browser/chromeos/login/session/user_session_manager.cc:106: language_preferred_languages.SetValue(JoinString(language_codes, ',')); On 2014/07/24 20:31:34, dzhioev wrote: > Could ...
6 years, 5 months ago (2014-07-25 23:49:08 UTC) #29
dzhioev (left Google)
Sorry for a long delay, I was sick all week. https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/160001/chrome/browser/chromeos/preferences.cc#newcode813 ...
6 years, 4 months ago (2014-08-01 15:30:41 UTC) #30
Shu Chen
https://codereview.chromium.org/312023002/diff/180001/chromeos/ime/extension_ime_util.h File chromeos/ime/extension_ime_util.h (right): https://codereview.chromium.org/312023002/diff/180001/chromeos/ime/extension_ime_util.h#newcode87 chromeos/ime/extension_ime_util.h:87: std::string CHROMEOS_EXPORT GetEngineIDByInputMethodID( You can remove this function now. ...
6 years, 4 months ago (2014-08-07 14:58:52 UTC) #31
dzhioev (left Google)
Hello Michael, are you going to finish this CL? This feature is on top of ...
6 years, 2 months ago (2014-10-14 13:37:20 UTC) #32
michaelpg
On 2014/10/14 13:37:20, dzhioev wrote: > Hello Michael, > are you going to finish this ...
6 years, 2 months ago (2014-10-14 17:28:51 UTC) #34
michaelpg
Please take (yet) another look: * Handles the recent xkb overhaul. * This was getting ...
6 years, 2 months ago (2014-10-20 23:47:28 UTC) #36
Nikita (slow)
Drive by comment. Heads up: both Pavel and Alexander are ooo till Nov 5th (vacation/offsite/public ...
6 years, 2 months ago (2014-10-21 11:45:57 UTC) #37
Alexander Alekseev
https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc#newcode60 chrome/browser/chromeos/preferences.cc:60: const input_method::InputMethodDescriptors& supported_descriptors) { Input arguments should go first. ...
6 years, 1 month ago (2014-10-28 15:11:00 UTC) #38
Alexander Alekseev
Sorry for the long delay. I was thinking if merge of local + remote preferences ...
6 years, 1 month ago (2014-10-28 15:14:59 UTC) #39
michaelpg
On 2014/10/28 15:14:59, Alexander Alekseev wrote: > Sorry for the long delay. I was thinking ...
6 years, 1 month ago (2014-11-04 16:58:34 UTC) #40
Takashi Toyoshima
Moved toyoshim@ from reviewers to CC.
6 years, 1 month ago (2014-11-06 10:53:49 UTC) #42
dzhioev (left Google)
LGTM with nits https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc#newcode242 chrome/browser/chromeos/preferences.cc:242: prefs_, callback); nit: fix indentation. https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc#newcode244 ...
6 years, 1 month ago (2014-11-06 16:11:06 UTC) #43
dzhioev (left Google)
https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc File chrome/browser/chromeos/preferences.cc (right): https://codereview.chromium.org/312023002/diff/240001/chrome/browser/chromeos/preferences.cc#newcode126 chrome/browser/chromeos/preferences.cc:126: for (size_t i = 0; i < src.size(); i++) ...
6 years, 1 month ago (2014-11-06 16:29:07 UTC) #44
michaelpg
Moved the InputMethodSyncer class from preferences.cc to input_method/input_method_syncer.cc. I'll add unit tests for this file ...
6 years, 1 month ago (2014-11-18 03:47:39 UTC) #47
Alexander Alekseev
lgtm
6 years, 1 month ago (2014-11-18 18:53:05 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/312023002/340001
6 years ago (2014-11-25 02:33:38 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/26441)
6 years ago (2014-11-25 02:38:12 UTC) #52
michaelpg
@dpolukhin: this needs a review for chrome/browser/chromeos. while nkostylev@ is OOO, could you take a ...
6 years ago (2014-11-30 23:44:04 UTC) #54
Dmitry Polukhin
lgtm
6 years ago (2014-12-01 07:45:59 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/312023002/360001
6 years ago (2014-12-01 08:30:31 UTC) #57
commit-bot: I haz the power
Committed patchset #14 (id:360001)
6 years ago (2014-12-01 09:10:30 UTC) #58
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/cceac6fae685fd86d6f347d6712886549e372231 Cr-Commit-Position: refs/heads/master@{#306164}
6 years ago (2014-12-01 09:11:20 UTC) #59
spang
https://codereview.chromium.org/312023002/diff/360001/chrome/browser/chromeos/input_method/input_method_syncer.cc File chrome/browser/chromeos/input_method/input_method_syncer.cc (right): https://codereview.chromium.org/312023002/diff/360001/chrome/browser/chromeos/input_method/input_method_syncer.cc#newcode241 chrome/browser/chromeos/input_method/input_method_syncer.cc:241: base::Passed(&languages))); It is not safe to .Pass() and .get() ...
6 years ago (2014-12-01 19:52:04 UTC) #61
spang
A revert of this CL (patchset #14 id:360001) has been created in https://codereview.chromium.org/756363003/ by spang@chromium.org. ...
6 years ago (2014-12-01 19:53:48 UTC) #62
michaelpg
Would someone mind taking another look? I've made a few changes to input_method_syncer.* to fix ...
6 years ago (2014-12-02 00:53:48 UTC) #63
Dmitry Polukhin
LGTM Passing string by value is better IMHO.
6 years ago (2014-12-03 08:40:50 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/312023002/400001
6 years ago (2014-12-05 02:43:02 UTC) #66
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/23346)
6 years ago (2014-12-05 03:05:24 UTC) #68
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/312023002/400001
6 years ago (2014-12-05 03:44:42 UTC) #70
commit-bot: I haz the power
Committed patchset #16 (id:400001)
6 years ago (2014-12-05 04:00:36 UTC) #71
commit-bot: I haz the power
6 years ago (2014-12-05 04:01:52 UTC) #72
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/975f2189e0e36e367a2fc0c7147373e34f3ffc46
Cr-Commit-Position: refs/heads/master@{#306976}

Powered by Google App Engine
This is Rietveld 408576698