| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session/logout_button_tray.h" | 5 #include "ash/system/chromeos/session/logout_button_tray.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 12 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
| 13 #include "ash/system/status_area_widget.h" | 13 #include "ash/system/status_area_widget.h" |
| 14 #include "ash/system/tray/system_tray_delegate.h" | 14 #include "ash/system/tray/system_tray_delegate.h" |
| 15 #include "ash/system/tray/system_tray_notifier.h" | 15 #include "ash/system/tray/system_tray_notifier.h" |
| 16 #include "ash/system/tray/tray_constants.h" | 16 #include "ash/system/tray/tray_constants.h" |
| 17 #include "ash/system/tray/tray_utils.h" | 17 #include "ash/system/tray/tray_utils.h" |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 tray_container()->AddChildView(button_); | 102 tray_container()->AddChildView(button_); |
| 103 tray_container()->SetBorder(views::Border::NullBorder()); | 103 tray_container()->SetBorder(views::Border::NullBorder()); |
| 104 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); | 104 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); |
| 105 } | 105 } |
| 106 | 106 |
| 107 LogoutButtonTray::~LogoutButtonTray() { | 107 LogoutButtonTray::~LogoutButtonTray() { |
| 108 Shell::GetInstance()->system_tray_notifier()-> | 108 Shell::GetInstance()->system_tray_notifier()-> |
| 109 RemoveLogoutButtonObserver(this); | 109 RemoveLogoutButtonObserver(this); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void LogoutButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { | 112 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 113 TrayBackgroundView::SetShelfAlignment(alignment); | 113 TrayBackgroundView::SetShelfAlignment(alignment); |
| 114 tray_container()->SetBorder(views::Border::NullBorder()); | 114 tray_container()->SetBorder(views::Border::NullBorder()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { | 117 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { |
| 118 return button_->GetText(); | 118 return button_->GetText(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void LogoutButtonTray::HideBubbleWithView( | 121 void LogoutButtonTray::HideBubbleWithView( |
| 122 const views::TrayBubbleView* bubble_view) { | 122 const views::TrayBubbleView* bubble_view) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 UpdateVisibility(); | 155 UpdateVisibility(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void LogoutButtonTray::UpdateVisibility() { | 158 void LogoutButtonTray::UpdateVisibility() { |
| 159 SetVisible(show_logout_button_in_tray_ && | 159 SetVisible(show_logout_button_in_tray_ && |
| 160 login_status_ != user::LOGGED_IN_NONE && | 160 login_status_ != user::LOGGED_IN_NONE && |
| 161 login_status_ != user::LOGGED_IN_LOCKED); | 161 login_status_ != user::LOGGED_IN_LOCKED); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace ash | 164 } // namespace ash |
| OLD | NEW |