| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/chromeos/screen_layout_observer.h" | 5 #include "ash/system/chromeos/screen_layout_observer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return base::string16(); | 61 return base::string16(); |
| 62 | 62 |
| 63 DCHECK(display->is_valid()); | 63 DCHECK(display->is_valid()); |
| 64 return base::UTF8ToUTF16(display->size().ToString()); | 64 return base::UTF8ToUTF16(display->size().ToString()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Attempts to open the display settings, returns true if successful. | 67 // Attempts to open the display settings, returns true if successful. |
| 68 bool OpenSettings() { | 68 bool OpenSettings() { |
| 69 // switch is intentionally introduced without default, to cause an error when | 69 // switch is intentionally introduced without default, to cause an error when |
| 70 // a new type of login status is introduced. | 70 // a new type of login status is introduced. |
| 71 switch (WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()) { | 71 switch (Shell::Get()->system_tray_delegate()->GetUserLoginStatus()) { |
| 72 case LoginStatus::NOT_LOGGED_IN: | 72 case LoginStatus::NOT_LOGGED_IN: |
| 73 case LoginStatus::LOCKED: | 73 case LoginStatus::LOCKED: |
| 74 return false; | 74 return false; |
| 75 | 75 |
| 76 case LoginStatus::USER: | 76 case LoginStatus::USER: |
| 77 case LoginStatus::OWNER: | 77 case LoginStatus::OWNER: |
| 78 case LoginStatus::GUEST: | 78 case LoginStatus::GUEST: |
| 79 case LoginStatus::PUBLIC: | 79 case LoginStatus::PUBLIC: |
| 80 case LoginStatus::SUPERVISED: | 80 case LoginStatus::SUPERVISED: |
| 81 case LoginStatus::KIOSK_APP: | 81 case LoginStatus::KIOSK_APP: |
| 82 case LoginStatus::ARC_KIOSK_APP: | 82 case LoginStatus::ARC_KIOSK_APP: |
| 83 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | 83 SystemTrayDelegate* delegate = Shell::Get()->system_tray_delegate(); |
| 84 if (delegate->ShouldShowSettings()) { | 84 if (delegate->ShouldShowSettings()) { |
| 85 WmShell::Get()->system_tray_controller()->ShowDisplaySettings(); | 85 Shell::Get()->system_tray_controller()->ShowDisplaySettings(); |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 break; | 88 break; |
| 89 } | 89 } |
| 90 | 90 |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 // Callback to handle a user selecting the notification view. | 94 // Callback to handle a user selecting the notification view. |
| 95 void OpenSettingsFromNotification() { | 95 void OpenSettingsFromNotification() { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return true; | 415 return true; |
| 416 | 416 |
| 417 default: | 417 default: |
| 418 // Mirror mode was turned off; other messages should be shown e.g. | 418 // Mirror mode was turned off; other messages should be shown e.g. |
| 419 // extended mode is on, ... etc. | 419 // extended mode is on, ... etc. |
| 420 return false; | 420 return false; |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace ash | 424 } // namespace ash |
| OLD | NEW |