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/common/system/chromeos/session/logout_button_tray.h" | 5 #include "ash/common/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/common/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 button_ = new LogoutButton(this); | 101 button_ = new LogoutButton(this); |
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 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); | 104 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); |
105 } | 105 } |
106 | 106 |
107 LogoutButtonTray::~LogoutButtonTray() { | 107 LogoutButtonTray::~LogoutButtonTray() { |
108 WmShell::Get()->system_tray_notifier()->RemoveLogoutButtonObserver(this); | 108 WmShell::Get()->system_tray_notifier()->RemoveLogoutButtonObserver(this); |
109 } | 109 } |
110 | 110 |
111 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment) { | 111 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment, |
112 TrayBackgroundView::SetShelfAlignment(alignment); | 112 const gfx::Insets& insets) { |
| 113 TrayBackgroundView::SetShelfAlignment(alignment, insets); |
113 tray_container()->SetBorder(views::Border::NullBorder()); | 114 tray_container()->SetBorder(views::Border::NullBorder()); |
114 } | 115 } |
115 | 116 |
116 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { | 117 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { |
117 return button_->GetText(); | 118 return button_->GetText(); |
118 } | 119 } |
119 | 120 |
120 void LogoutButtonTray::HideBubbleWithView( | 121 void LogoutButtonTray::HideBubbleWithView( |
121 const views::TrayBubbleView* bubble_view) {} | 122 const views::TrayBubbleView* bubble_view) {} |
122 | 123 |
(...skipping 29 matching lines...) Expand all Loading... |
152 UpdateVisibility(); | 153 UpdateVisibility(); |
153 } | 154 } |
154 | 155 |
155 void LogoutButtonTray::UpdateVisibility() { | 156 void LogoutButtonTray::UpdateVisibility() { |
156 SetVisible(show_logout_button_in_tray_ && | 157 SetVisible(show_logout_button_in_tray_ && |
157 login_status_ != LoginStatus::NOT_LOGGED_IN && | 158 login_status_ != LoginStatus::NOT_LOGGED_IN && |
158 login_status_ != LoginStatus::LOCKED); | 159 login_status_ != LoginStatus::LOCKED); |
159 } | 160 } |
160 | 161 |
161 } // namespace ash | 162 } // namespace ash |
OLD | NEW |