| Index: ash/system/screen_layout_observer.cc
|
| diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc
|
| index c7ea0e5f89313181e426e16cb7fec05355fa4cb1..0ead7c5d1b20805b7b904000800e70833047c2b4 100644
|
| --- a/ash/system/screen_layout_observer.cc
|
| +++ b/ash/system/screen_layout_observer.cc
|
| @@ -11,6 +11,7 @@
|
| #include "ash/display/screen_orientation_controller_chromeos.h"
|
| #include "ash/metrics/user_metrics_action.h"
|
| #include "ash/resources/grit/ash_resources.h"
|
| +#include "ash/session/session_controller.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_port.h"
|
| #include "ash/strings/grit/ash_strings.h"
|
| @@ -18,7 +19,6 @@
|
| #include "ash/system/system_notifier.h"
|
| #include "ash/system/tray/fixed_sized_image_view.h"
|
| #include "ash/system/tray/system_tray_controller.h"
|
| -#include "ash/system/tray/system_tray_delegate.h"
|
| #include "ash/system/tray/tray_constants.h"
|
| #include "base/bind.h"
|
| #include "base/strings/string_util.h"
|
| @@ -64,38 +64,13 @@ base::string16 GetDisplaySize(int64_t display_id) {
|
| return base::UTF8ToUTF16(display->size().ToString());
|
| }
|
|
|
| -// Attempts to open the display settings, returns true if successful.
|
| -bool OpenSettings() {
|
| - // switch is intentionally introduced without default, to cause an error when
|
| - // a new type of login status is introduced.
|
| - switch (Shell::Get()->system_tray_delegate()->GetUserLoginStatus()) {
|
| - case LoginStatus::NOT_LOGGED_IN:
|
| - case LoginStatus::LOCKED:
|
| - return false;
|
| -
|
| - case LoginStatus::USER:
|
| - case LoginStatus::OWNER:
|
| - case LoginStatus::GUEST:
|
| - case LoginStatus::PUBLIC:
|
| - case LoginStatus::SUPERVISED:
|
| - case LoginStatus::KIOSK_APP:
|
| - case LoginStatus::ARC_KIOSK_APP:
|
| - SystemTrayDelegate* delegate = Shell::Get()->system_tray_delegate();
|
| - if (delegate->ShouldShowSettings()) {
|
| - Shell::Get()->system_tray_controller()->ShowDisplaySettings();
|
| - return true;
|
| - }
|
| - break;
|
| - }
|
| -
|
| - return false;
|
| -}
|
| -
|
| // Callback to handle a user selecting the notification view.
|
| void OpenSettingsFromNotification() {
|
| ShellPort::Get()->RecordUserMetricsAction(
|
| UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED);
|
| - if (OpenSettings()) {
|
| + // Settings may be blocked, e.g. at the lock screen.
|
| + if (Shell::Get()->session_controller()->ShouldEnableSettings()) {
|
| + Shell::Get()->system_tray_controller()->ShowDisplaySettings();
|
| ShellPort::Get()->RecordUserMetricsAction(
|
| UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SHOW_SETTINGS);
|
| }
|
|
|