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/user/tray_user.h" | 5 #include "ash/system/user/tray_user.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return user_; | 112 return user_; |
113 } | 113 } |
114 | 114 |
115 views::View* TrayUser::CreateDetailedView(user::LoginStatus status) { | 115 views::View* TrayUser::CreateDetailedView(user::LoginStatus status) { |
116 const AccountId account_id = Shell::GetInstance() | 116 const AccountId account_id = Shell::GetInstance() |
117 ->session_state_delegate() | 117 ->session_state_delegate() |
118 ->GetUserInfo(0) | 118 ->GetUserInfo(0) |
119 ->GetAccountId(); | 119 ->GetAccountId(); |
120 tray::UserAccountsDelegate* delegate = | 120 tray::UserAccountsDelegate* delegate = |
121 Shell::GetInstance()->system_tray_delegate()->GetUserAccountsDelegate( | 121 Shell::GetInstance()->system_tray_delegate()->GetUserAccountsDelegate( |
122 account_id.GetUserEmail()); | 122 account_id); |
123 if (!delegate) | 123 if (!delegate) |
124 return nullptr; | 124 return nullptr; |
125 return new tray::AccountsDetailedView(this, status, delegate); | 125 return new tray::AccountsDetailedView(this, status, delegate); |
126 } | 126 } |
127 | 127 |
128 void TrayUser::DestroyTrayView() { | 128 void TrayUser::DestroyTrayView() { |
129 layout_view_ = nullptr; | 129 layout_view_ = nullptr; |
130 avatar_ = nullptr; | 130 avatar_ = nullptr; |
131 label_ = nullptr; | 131 label_ = nullptr; |
132 } | 132 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 void TrayUser::UpdateLayoutOfItem() { | 291 void TrayUser::UpdateLayoutOfItem() { |
292 RootWindowController* controller = GetRootWindowController( | 292 RootWindowController* controller = GetRootWindowController( |
293 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); | 293 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); |
294 if (controller && controller->shelf()) { | 294 if (controller && controller->shelf()) { |
295 UpdateAfterShelfAlignmentChange( | 295 UpdateAfterShelfAlignmentChange( |
296 controller->GetShelfLayoutManager()->GetAlignment()); | 296 controller->GetShelfLayoutManager()->GetAlignment()); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 } // namespace ash | 300 } // namespace ash |
OLD | NEW |