New issue
Advanced search Search tips

Issue 699234 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

mash: Don't show "sign out" in system tray at the login screen

Project Member Reported by jamescook@chromium.org, Mar 7 2017

Issue description

This is probably a SystemTrayDelegate issue. We should not be creating a UserView at the login screen at all.

I suspect something is wrong with LoginStatus when creating the system tray bubble.

One clue:

views::View* TrayUser::CreateDefaultView(LoginStatus status) {
  if (status == LoginStatus::NOT_LOGGED_IN)
    return nullptr;
  const SessionStateDelegate* session_state_delegate =
      WmShell::Get()->GetSessionStateDelegate();

  // If the screen is locked or a system modal dialog box is shown, show only
  // the currently active user.
  if (user_index_ && (session_state_delegate->IsUserSessionBlocked() ||
                      WmShell::Get()->IsSystemModalWindowOpen()))
    return nullptr;

  CHECK(user_ == nullptr);

  int logged_in_users = session_state_delegate->NumberOfLoggedInUsers();

  // Do not show more UserView's then there are logged in users.
  if (user_index_ >= logged_in_users)
    return nullptr;

  user_ = new tray::UserView(this, status, user_index_);
  return user_;
}

This code in system_tray.cc might be the root cause:

    LoginStatus login_status =
        WmShell::Get()->system_tray_delegate()->GetUserLoginStatus();
    bubble_->InitView(anchor, login_status, init_params);

I'll take a look.

 
It is probably because I have not updated ash to call SessionController yet.

CL is almost ready. I finally get it compiled yesterday. Fixing broken tests now.
https://codereview.chromium.org/2734933004/ in case you want to try.

I will ask for review when it is ready...  would also try to break it down a bit (if I can. :p)
Cc: -xiy...@chromium.org jamescook@chromium.org
Owner: xiy...@chromium.org
Status: Assigned (was: Started)
xiyuan's CL probably fixes this issue.

(And yes, splitting up that CL for review would be great. :-)

We will still probably need an implementation of GetUserLoginStatus() for mash, because lots and lots of code in the system tray uses it.

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/063733f75d45987b9db79b3e423603908bb558d0

commit 063733f75d45987b9db79b3e423603908bb558d0
Author: jamescook <jamescook@chromium.org>
Date: Mon Mar 13 23:27:52 2017

mash: Update LoginStatus with session state updates

In classic ash, chrome calls WmShell::UpdateUserLoginStatus() directly,
which updates the appearance of the system tray menu, status area
notifications icon, etc.

Fix mash so it updates LoginStatus as well so that the system tray menu
works more similarly to classic ash. (For example, it now hides the
notifications icon during oobe, hides the "sign out" item in the system
tray menu at the login screen, etc.)

BUG= 699234 , 648964 
TEST=added to ash_unittests SessionControllerTest

Review-Url: https://codereview.chromium.org/2741403004
Cr-Commit-Position: refs/heads/master@{#456540}

[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/common/session/session_controller.cc
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/common/session/session_controller.h
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/common/session/session_controller_unittest.cc
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/common/wm_shell.cc
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/mus/system_tray_delegate_mus.cc
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/mus/system_tray_delegate_mus.h
[modify] https://crrev.com/063733f75d45987b9db79b3e423603908bb558d0/ash/shell.h

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef

commit f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef
Author: xiyuan <xiyuan@chromium.org>
Date: Mon Mar 20 20:28:14 2017

ash: Use SessionController instead of SessionStateDelegate

- Switch SessionStateDelegate callers to SessionController;
- Remove all migrated methods from SessionStateDelegate;
- Update tests;
- Update ash_shell_with_content;
- Changed ScreenLocker to set SessionState::ACTIVE before destroying
  LockWindow so that focus is properly restored after lock;
- Changed UserSessionManager to set SessionState::ACTIVE before
  creating browser window so that the created window receives focus;

BUG= 648964 , 699234 

Review-Url: https://codereview.chromium.org/2734933004
Cr-Commit-Position: refs/heads/master@{#458168}

[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/BUILD.gn
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/accelerators/accelerator_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/accelerators/accelerator_filter_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/accelerators/accelerator_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/session/session_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/session/session_controller.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/session/session_controller_unittest.cc
[delete] https://crrev.com/fc7f323f548c926b99fe6ebd15f46a514f0df198/ash/common/session/session_state_delegate.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/session/session_state_delegate.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/session/session_state_observer.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/shelf/shelf_layout_manager.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/shelf/shelf_locking_manager.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/shelf/shelf_locking_manager.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/shelf/shelf_widget.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/shelf/shelf_window_watcher_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/chromeos/media_security/multi_profile_media_tray_item.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/chromeos/media_security/multi_profile_media_tray_item_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/chromeos/network/tray_vpn.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/chromeos/palette/palette_tray.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/chromeos/settings/tray_settings.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/date/date_default_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/overview/overview_button_tray.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/tiles/tiles_default_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/tray/system_tray.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/tray/tray_popup_utils.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/user/login_status.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/user/tray_user.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/user/tray_user_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/user/user_card_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/user/user_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/system/web_notification/web_notification_tray.cc
[add] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/test/test_session_controller_client.cc
[add] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/test/test_session_controller_client.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/test/test_session_state_delegate.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/test/test_session_state_delegate.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/test/test_system_tray_delegate.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wallpaper/wallpaper_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/container_finder.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/maximize_mode/maximize_mode_event_handler.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/overview/window_selector_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/system_modal_container_layout_manager.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/window_cycle_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/workspace/workspace_layout_manager.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/common/wm_shell.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/mus/bridge/wm_shell_mus.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/mus/shell_delegate_mus.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/root_window_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/root_window_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shelf/shelf_layout_manager_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/app_list.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/content/client/shell_browser_main_parts.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/content/client/shell_browser_main_parts.h
[add] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/example_session_controller_client.cc
[add] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/example_session_controller_client.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/lock_view.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/shell_delegate_impl.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell/window_type_launcher.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/shell_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/chromeos/power/power_event_observer.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/chromeos/power/power_event_observer_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/chromeos/power/tablet_power_button_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/chromeos/power/video_activity_notifier.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/system/overview/overview_button_tray_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/BUILD.gn
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/ash_interactive_ui_test_base.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/ash_test_base.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/ash_test_base.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/ash_test_helper.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/test/ash_test_helper.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/always_on_top_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/ash_focus_rules_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/event_client_impl.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/lock_state_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/power_button_controller.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ash/wm/window_cycle_controller_unittest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/chromeos/login/lock/screen_locker.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/chromeos/login/lock/screen_locker_browsertest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/browser/ui/ash/session_state_delegate_chromeos.h
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/chrome/test/base/view_event_test_platform_part_chromeos.cc
[modify] https://crrev.com/f1ff14d7d25d3c37239e6804a3bfd6928c9cd1ef/ui/aura/mus/window_tree_client.cc

Comment 6 by xiy...@chromium.org, Mar 20 2017

Status: Fixed (was: Assigned)

Comment 7 by dchan@google.com, May 30 2017

Labels: VerifyIn-60

Comment 8 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 9 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)
Components: -Internals>MUS Internals>Services>WindowService

Sign in to add a comment