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

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed)

Created:
7 years, 7 months ago by Mr4D (OOO till 08-26)
Modified:
7 years, 7 months ago
CC:
chromium-reviews, sadrul, nkostylev+watch_chromium.org, ben+watch_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, bartfab (slow)
Visibility:
Public.

Description

Adding new user menu section to the SystemTrayMenu & refactoring of user access It is still not fully finished - but it is functional and might be useful for what you are doing (and already quite big as it is). Note that the functionality is controlled by the flag. What is missing? - There are no unit tests yet - The visual Drop down box to add a new user is missing. - The error message box which shows the error if there are already 3 users signed in is missing. - At the moment I have ~7 lines of test code in there which I will remove before I check in. (I need them since the multi login still does not work for me) I am not sure if you want to wait until I finish the issue - or if you'd rather want to have this to be able to rather merge early then later. I leave this up to you. If you are for the latter one, you can have at least a look at my changes and if they conflict with yours. BUG=239201 TEST=visual Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200978

Patch Set 1 #

Total comments: 32

Patch Set 2 : Addressed #

Total comments: 54

Patch Set 3 : Addressed #

Patch Set 4 : Removed the debugging helper constant by setting it to 0 again #

Patch Set 5 : Build problem #

Patch Set 6 : Windows build problems #

Patch Set 7 : More windows breakages addressed #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+634 lines, -183 lines) Patch
M ash/ash_strings.grd View 2 chunks +12 lines, -0 lines 0 comments Download
M ash/desktop_background/desktop_background_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/root_window_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/root_window_controller_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ash/session_state_delegate.h View 1 2 chunks +40 lines, -2 lines 2 comments Download
M ash/session_state_delegate_stub.h View 1 2 chunks +14 lines, -1 line 0 comments Download
M ash/session_state_delegate_stub.cc View 1 2 3 chunks +30 lines, -2 lines 0 comments Download
M ash/shell.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/system_tray.cc View 1 1 chunk +11 lines, -1 line 0 comments Download
M ash/system/tray/system_tray_delegate.h View 2 chunks +0 lines, -11 lines 0 comments Download
M ash/system/tray/system_tray_item.h View 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/test_system_tray_delegate.h View 2 chunks +0 lines, -6 lines 0 comments Download
M ash/system/tray/test_system_tray_delegate.cc View 3 chunks +0 lines, -20 lines 0 comments Download
M ash/system/user/login_status.cc View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M ash/system/user/tray_user.h View 3 chunks +9 lines, -1 line 0 comments Download
M ash/system/user/tray_user.cc View 1 2 3 4 21 chunks +296 lines, -97 lines 0 comments Download
M ash/test/test_session_state_delegate.h View 1 3 chunks +14 lines, -1 line 0 comments Download
M ash/test/test_session_state_delegate.cc View 1 3 chunks +32 lines, -2 lines 0 comments Download
M ash/wm/gestures/shelf_gesture_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/mock_user_manager.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager.h View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager_impl.h View 1 2 3 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager_impl.cc View 1 2 5 chunks +26 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/system/ash_system_tray_delegate.cc View 3 chunks +2 lines, -26 lines 0 comments Download
M chrome/browser/ui/ash/session_state_delegate.h View 1 1 chunk +10 lines, -1 line 0 comments Download
M chrome/browser/ui/ash/session_state_delegate_chromeos.cc View 1 2 3 2 chunks +61 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/session_state_delegate_views.cc View 1 2 3 4 5 6 2 chunks +44 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Mr4D (OOO till 08-26)
Please see my general CL comment for more information. I am fine either way: We ...
7 years, 7 months ago (2013-05-17 04:08:33 UTC) #1
James Cook
Overall seems fine, a few specific comments https://codereview.chromium.org/14756019/diff/1/ash/ash_strings.grd File ash/ash_strings.grd (right): https://codereview.chromium.org/14756019/diff/1/ash/ash_strings.grd#newcode218 ash/ash_strings.grd:218: <message name="IDS_ASH_STATUS_TRAY_SIGN_OUT_ALL" ...
7 years, 7 months ago (2013-05-17 14:03:25 UTC) #2
Mr4D (OOO till 08-26)
Addressed! Please have another look! https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h File ash/session_state_delegate.h (right): https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#newcode24 ash/session_state_delegate.h:24: // A list of ...
7 years, 7 months ago (2013-05-17 16:26:40 UTC) #3
James Cook
lgtm
7 years, 7 months ago (2013-05-17 16:44:58 UTC) #4
Nikita (slow)
overall looks good, mostly nits cc: Bartosz for SessionStateDelegate. https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h File ash/session_state_delegate.h (right): https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#newcode24 ash/session_state_delegate.h:24: ...
7 years, 7 months ago (2013-05-17 17:00:31 UTC) #5
Mr4D (OOO till 08-26)
Addressed. https://codereview.chromium.org/14756019/diff/9001/ash/ash_strings.grd File ash/ash_strings.grd (right): https://codereview.chromium.org/14756019/diff/9001/ash/ash_strings.grd#newcode218 ash/ash_strings.grd:218: <message name="IDS_ASH_STATUS_TRAY_SIGN_OUT_ALL" desc="The label used for the button ...
7 years, 7 months ago (2013-05-17 18:45:09 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/14756019/10032
7 years, 7 months ago (2013-05-17 18:45:22 UTC) #7
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=3588
7 years, 7 months ago (2013-05-17 18:55:27 UTC) #8
Nikita (slow)
lgtm https://codereview.chromium.org/14756019/diff/9001/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): https://codereview.chromium.org/14756019/diff/9001/ash/system/user/tray_user.cc#newcode622 ash/system/user/tray_user.cc:622: user_card_ = new UserCard(this, multiprofile_index_ == 0); On ...
7 years, 7 months ago (2013-05-17 19:15:46 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/14756019/8005
7 years, 7 months ago (2013-05-17 19:37:56 UTC) #10
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 7 months ago (2013-05-17 20:00:53 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/14756019/22001
7 years, 7 months ago (2013-05-17 20:04:33 UTC) #12
Mr4D (OOO till 08-26)
Addressed - and many thanks for your quick review! (more with the second CL :) ...
7 years, 7 months ago (2013-05-17 20:04:42 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/14756019/31001
7 years, 7 months ago (2013-05-17 21:01:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/14756019/44001
7 years, 7 months ago (2013-05-17 23:50:51 UTC) #15
commit-bot: I haz the power
Change committed as 200978
7 years, 7 months ago (2013-05-18 09:09:43 UTC) #16
bartfab (slow)
https://codereview.chromium.org/14756019/diff/44001/ash/session_state_delegate.h File ash/session_state_delegate.h (right): https://codereview.chromium.org/14756019/diff/44001/ash/session_state_delegate.h#newcode64 ash/session_state_delegate.h:64: virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0; Ugh. ...
7 years, 7 months ago (2013-05-21 09:26:01 UTC) #17
Nikita (slow)
https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h File ash/session_state_delegate.h (right): https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#newcode24 ash/session_state_delegate.h:24: // A list of eMail addresses. On 2013/05/17 17:00:31, ...
7 years, 7 months ago (2013-05-21 09:57:36 UTC) #18
Mr4D (OOO till 08-26)
7 years, 7 months ago (2013-05-21 15:48:43 UTC) #19
Message was sent while issue was closed.
Fot the "not addressed issues": I think I have addressed all of them - except
for the eMail -> user_id change (and I have put in a comment for that):

I have two reasons why I would not be in favor of such a change:
1. email is much clearer then user_id. A user id could be a number or maybe a
GUID or what not. But I would surely not expect it to be an email address.
2. In all relevant cases this *is* an email address. For all remaining cases
(which are probably the minority of cases >10%?) this value gets - as far as I
know - ignored and makes no sense.

What about: GetUserEmail -> GetUserId and GetDisplayEmail -> GetEmail? I think
that would be much clearer and address all concerns.

As such it seems to me much clearer to name them to what they really are: email
addresses.
Ad discussed with nkostylev: If the consensus is to use user_id I will change it

https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h
File ash/session_state_delegate.h (right):

https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#...
ash/session_state_delegate.h:24: // A list of eMail addresses.
Which one? I commented on every one and the email -> userid I had my doubts that
that would be a good idea and we should address that separately with a new CL
after a "global OK" to do this change.

https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#...
ash/session_state_delegate.h:24: // A list of eMail addresses.
I have two reasons why I would not be in favor of such a change:
1. email is much clearer then user_id. A user id could be a number or maybe a
GUID. But I would surely not expect it to be an email address.
2. In all relevant cases this *is* an email address. For all remaining cases
(which are probably the minority of cases >10%?) this value gets - as far as I
know - ignored and makes no sense.

As such it seems to me much clearer to name them what they are: email addresses.
That said: If the consensus is to use user_id I will change it.

https://codereview.chromium.org/14756019/diff/1/ash/session_state_delegate.h#...
ash/session_state_delegate.h:33: // no session in progress or no active user.
I looked at the code and it appeared to me that the user list can be empty, but
the function GetActiveUser (or wat ever the exact name was) would return a user.
(I can look up the exact code locations if you want). Since this function looked
only at the length of the user list it would get a 0 in that case.

https://codereview.chromium.org/14756019/diff/44001/ash/session_state_delegate.h
File ash/session_state_delegate.h (right):

https://codereview.chromium.org/14756019/diff/44001/ash/session_state_delegat...
ash/session_state_delegate.h:64: virtual const std::string
GetUserEmail(MultiProfileIndex index) const = 0;
This function is needed by the UI in order to show the logged in eMail address.
It does not show a UserID since that might change in the future to something
else then the eMail address (or the name is not clear). As such this function
should have exactly this name and nothing with UserID in it. That would be
really confusing.

I discussed this now with nkostylev and we will run this namechange (email
->userid) by the team and see for any objections. If everyone is happy I will
change.

On a side note: The UI faces the user name and the user eMail to the user. As
such using the term eMail is much clearer then user_id. Granted it only makes
sense with GAIA, but that is the main use case we care about in the UI planning
(other non logged in users won't show this).

Once everyone agrees on this name change I can change the names in a later CL.

Powered by Google App Engine
This is Rietveld 408576698