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/shelf/shelf_types.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 tray_container()->AddChildView(button_); | 103 tray_container()->AddChildView(button_); |
104 tray_container()->SetBorder(views::Border::NullBorder()); | 104 tray_container()->SetBorder(views::Border::NullBorder()); |
105 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); | 105 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); |
106 } | 106 } |
107 | 107 |
108 LogoutButtonTray::~LogoutButtonTray() { | 108 LogoutButtonTray::~LogoutButtonTray() { |
109 Shell::GetInstance()->system_tray_notifier()-> | 109 Shell::GetInstance()->system_tray_notifier()-> |
110 RemoveLogoutButtonObserver(this); | 110 RemoveLogoutButtonObserver(this); |
111 } | 111 } |
112 | 112 |
113 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment) { | 113 void LogoutButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { |
114 TrayBackgroundView::SetShelfAlignment(alignment); | 114 TrayBackgroundView::SetShelfAlignment(alignment); |
115 tray_container()->SetBorder(views::Border::NullBorder()); | 115 tray_container()->SetBorder(views::Border::NullBorder()); |
116 } | 116 } |
117 | 117 |
118 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { | 118 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { |
119 return button_->GetText(); | 119 return button_->GetText(); |
120 } | 120 } |
121 | 121 |
122 void LogoutButtonTray::HideBubbleWithView( | 122 void LogoutButtonTray::HideBubbleWithView( |
123 const views::TrayBubbleView* bubble_view) { | 123 const views::TrayBubbleView* bubble_view) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 UpdateVisibility(); | 158 UpdateVisibility(); |
159 } | 159 } |
160 | 160 |
161 void LogoutButtonTray::UpdateVisibility() { | 161 void LogoutButtonTray::UpdateVisibility() { |
162 SetVisible(show_logout_button_in_tray_ && | 162 SetVisible(show_logout_button_in_tray_ && |
163 login_status_ != user::LOGGED_IN_NONE && | 163 login_status_ != user::LOGGED_IN_NONE && |
164 login_status_ != user::LOGGED_IN_LOCKED); | 164 login_status_ != user::LOGGED_IN_LOCKED); |
165 } | 165 } |
166 | 166 |
167 } // namespace ash | 167 } // namespace ash |
OLD | NEW |