| 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/tray_display.h" | 5 #include "ash/system/chromeos/tray_display.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 lines.push_back(GetDisplayInfoLine(id)); | 111 lines.push_back(GetDisplayInfoLine(id)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 return base::JoinString(lines, base::ASCIIToUTF16("\n")); | 114 return base::JoinString(lines, base::ASCIIToUTF16("\n")); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void OpenSettings() { | 117 void OpenSettings() { |
| 118 // switch is intentionally introduced without default, to cause an error when | 118 // switch is intentionally introduced without default, to cause an error when |
| 119 // a new type of login status is introduced. | 119 // a new type of login status is introduced. |
| 120 switch (Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus()) { | 120 switch (Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus()) { |
| 121 case user::LOGGED_IN_NONE: | 121 case LoginStatus::NOT_LOGGED_IN: |
| 122 case user::LOGGED_IN_LOCKED: | 122 case LoginStatus::LOCKED: |
| 123 return; | 123 return; |
| 124 | 124 |
| 125 case user::LOGGED_IN_USER: | 125 case LoginStatus::USER: |
| 126 case user::LOGGED_IN_OWNER: | 126 case LoginStatus::OWNER: |
| 127 case user::LOGGED_IN_GUEST: | 127 case LoginStatus::GUEST: |
| 128 case user::LOGGED_IN_PUBLIC: | 128 case LoginStatus::PUBLIC: |
| 129 case user::LOGGED_IN_SUPERVISED: | 129 case LoginStatus::SUPERVISED: |
| 130 case user::LOGGED_IN_KIOSK_APP: | 130 case LoginStatus::KIOSK_APP: |
| 131 ash::SystemTrayDelegate* delegate = | 131 ash::SystemTrayDelegate* delegate = |
| 132 Shell::GetInstance()->system_tray_delegate(); | 132 Shell::GetInstance()->system_tray_delegate(); |
| 133 if (delegate->ShouldShowSettings()) | 133 if (delegate->ShouldShowSettings()) |
| 134 delegate->ShowDisplaySettings(); | 134 delegate->ShowDisplaySettings(); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace | 138 } // namespace |
| 139 | 139 |
| 140 const char TrayDisplay::kNotificationId[] = "chrome://settings/display"; | 140 const char TrayDisplay::kNotificationId[] = "chrome://settings/display"; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 408 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 409 system_notifier::kNotifierDisplay), | 409 system_notifier::kNotifierDisplay), |
| 410 message_center::RichNotificationData(), | 410 message_center::RichNotificationData(), |
| 411 new message_center::HandleNotificationClickedDelegate( | 411 new message_center::HandleNotificationClickedDelegate( |
| 412 base::Bind(&OpenSettings)))); | 412 base::Bind(&OpenSettings)))); |
| 413 | 413 |
| 414 message_center::MessageCenter::Get()->AddNotification( | 414 message_center::MessageCenter::Get()->AddNotification( |
| 415 std::move(notification)); | 415 std::move(notification)); |
| 416 } | 416 } |
| 417 | 417 |
| 418 views::View* TrayDisplay::CreateDefaultView(user::LoginStatus status) { | 418 views::View* TrayDisplay::CreateDefaultView(LoginStatus status) { |
| 419 DCHECK(default_ == NULL); | 419 DCHECK(default_ == NULL); |
| 420 default_ = new DisplayView(); | 420 default_ = new DisplayView(); |
| 421 return default_; | 421 return default_; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void TrayDisplay::DestroyDefaultView() { | 424 void TrayDisplay::DestroyDefaultView() { |
| 425 default_ = NULL; | 425 default_ = NULL; |
| 426 } | 426 } |
| 427 | 427 |
| 428 void TrayDisplay::OnDisplayConfigurationChanged() { | 428 void TrayDisplay::OnDisplayConfigurationChanged() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 453 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { | 453 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { |
| 454 views::View* view = default_; | 454 views::View* view = default_; |
| 455 if (view) { | 455 if (view) { |
| 456 view->GetAccessibleState(state); | 456 view->GetAccessibleState(state); |
| 457 return true; | 457 return true; |
| 458 } | 458 } |
| 459 return false; | 459 return false; |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace ash | 462 } // namespace ash |
| OLD | NEW |