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

Issue 476993002: [Profiles] Fix the usage of custom/default names and avatars (Closed)

Created:
6 years, 4 months ago by noms (inactive)
Modified:
6 years, 4 months ago
CC:
Marc Treib, chromium-reviews, dbeam+watch-options_chromium.org
Project:
chromium
Visibility:
Public.

Description

[Profiles] Fix the usage of custom/default names and avatars (Hopefully for the last time). This is based on treib's patch 476703002 The problem that this CL is fixing is that it was a mess to tell whether a user had a default name/avatar (Lemonade) because we randomly assigned it at a profile creation time (in old, legacy cases), and then they synced it because that's what sync does, or because they did that on purpose. The idea being, of course, that if we randomly called them Lemonade and they have a Gaia name, we should use the latter, but if they synced "bob", we should use the sync name. Ok. Here's how this works now: - there's a preference for the profile name, and a preference "if it's default" - if this preference is not set, we assume this is a legacy created profile, so if it is named First User or Lemonade, the user probably didn't change that. This sets a "kIsUsingDefaultNameKey" preference in the ProfileInfoCache - if the ProfileInfoCache has a profile with a kIsUsingDefaultNameKey, then it uses a Gaia name if it's available. - the moment the user changes the name of a profile, it stops being default. So even if I change the profile name from Lemonade to Pickles, even though Pickles is one of the default profile names, we allow this insanity. - a similar dance is done for the default avatar/gaia avatar, only here we maintain two preferences, because the ProfileInfoCache holds both the gaia and the profile avatar. Profiles, right? <3 BUG=394586 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290101

Patch Set 1 #

Total comments: 12

Patch Set 2 : review comments + fixed tests = \o/ #

Patch Set 3 : fix other test (argh, and a rebase) #

Patch Set 4 : all rebase all the time #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -49 lines) Patch
M chrome/browser/profiles/gaia_info_update_service_unittest.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 4 chunks +41 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_info_cache.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_info_cache.cc View 1 2 3 6 chunks +35 lines, -30 lines 0 comments Download
M chrome/browser/profiles/profile_info_cache_unittest.cc View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_manager_unittest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profiles_state.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profiles_state.cc View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/options/manage_profile_handler.cc View 1 2 3 chunks +8 lines, -12 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
noms (inactive)
Hi everyone, Please read the (very long) CL description for what this CL is trying ...
6 years, 4 months ago (2014-08-14 23:05:47 UTC) #1
Bernhard Bauer
https://memegen.googleplex.com/6415975698137088 Is this meant to supercede Marc's CL, or is land after it? In the ...
6 years, 4 months ago (2014-08-15 14:39:23 UTC) #2
noms (inactive)
This is meant to supercede it.
6 years, 4 months ago (2014-08-15 14:40:32 UTC) #3
Roger Tawa OOO till Jul 10th
Some questions below. https://codereview.chromium.org/476993002/diff/1/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): https://codereview.chromium.org/476993002/diff/1/chrome/browser/profiles/profile_impl.cc#newcode375 chrome/browser/profiles/profile_impl.cc:375: user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); Should use enum for -1, ...
6 years, 4 months ago (2014-08-15 14:46:40 UTC) #4
noms (inactive)
Addressed comments. Most notably, the default name preference changed from an integer to a boolean, ...
6 years, 4 months ago (2014-08-15 16:22:47 UTC) #5
Bernhard Bauer
LGTM!
6 years, 4 months ago (2014-08-15 16:30:01 UTC) #6
Roger Tawa OOO till Jul 10th
lgtm
6 years, 4 months ago (2014-08-15 17:16:38 UTC) #7
rpetterson
profiles LGTM per our offline discussion
6 years, 4 months ago (2014-08-15 20:19:42 UTC) #8
noms (inactive)
+ alexei for the cocoa unittest
6 years, 4 months ago (2014-08-15 20:21:52 UTC) #9
Alexei Svitkine (slow)
lgtm
6 years, 4 months ago (2014-08-15 20:23:21 UTC) #10
noms (inactive)
Wooooo thanks for playing, everyone! Here is a piglet jumping over a baffled dog: http://i.imgur.com/IWDpdSD.gif ...
6 years, 4 months ago (2014-08-15 20:26:11 UTC) #11
noms (inactive)
The CQ bit was checked by noms@chromium.org
6 years, 4 months ago (2014-08-15 20:26:33 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/476993002/40001
6 years, 4 months ago (2014-08-15 20:31:33 UTC) #13
Bernhard Bauer
On 2014/08/15 20:26:11, Monica Dinculescu wrote: > Wooooo thanks for playing, everyone! Here is a ...
6 years, 4 months ago (2014-08-15 20:40:00 UTC) #14
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-15 21:33:25 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-15 21:39:07 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_triggered_tests/builds/6256)
6 years, 4 months ago (2014-08-15 21:39:08 UTC) #17
noms (inactive)
The CQ bit was checked by noms@chromium.org
6 years, 4 months ago (2014-08-15 22:45:16 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/476993002/60001
6 years, 4 months ago (2014-08-15 22:47:52 UTC) #19
commit-bot: I haz the power
6 years, 4 months ago (2014-08-16 06:00:54 UTC) #20
Message was sent while issue was closed.
Committed patchset #4 (60001) as 290101

Powered by Google App Engine
This is Rietveld 408576698