| 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/user/accounts_detailed_view.h" | 5 #include "ash/system/user/accounts_detailed_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/multi_profile_uma.h" | 9 #include "ash/multi_profile_uma.h" |
| 10 #include "ash/session/user_info.h" | |
| 11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 12 #include "ash/system/tray/fixed_sized_scroll_view.h" | 11 #include "ash/system/tray/fixed_sized_scroll_view.h" |
| 13 #include "ash/system/tray/hover_highlight_view.h" | 12 #include "ash/system/tray/hover_highlight_view.h" |
| 14 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
| 15 #include "ash/system/tray/system_tray_delegate.h" | 14 #include "ash/system/tray/system_tray_delegate.h" |
| 16 #include "ash/system/tray/tray_constants.h" | 15 #include "ash/system/tray/tray_constants.h" |
| 17 #include "ash/system/tray/tray_popup_header_button.h" | 16 #include "ash/system/tray/tray_popup_header_button.h" |
| 18 #include "ash/system/user/config.h" | 17 #include "ash/system/user/config.h" |
| 19 #include "ash/system/user/tray_user.h" | 18 #include "ash/system/user/tray_user.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "components/user_manager/user_info.h" |
| 21 #include "grit/ash_resources.h" | 21 #include "grit/ash_resources.h" |
| 22 #include "grit/ui_resources.h" | 22 #include "grit/ui_resources.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/views/border.h" | 24 #include "ui/views/border.h" |
| 25 #include "ui/views/layout/box_layout.h" | 25 #include "ui/views/layout/box_layout.h" |
| 26 #include "ui/views/layout/grid_layout.h" | 26 #include "ui/views/layout/grid_layout.h" |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 namespace tray { | 29 namespace tray { |
| 30 | 30 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 scroll_content()->AddChildView(account_list_title); | 113 scroll_content()->AddChildView(account_list_title); |
| 114 account_list_ = new views::View(); | 114 account_list_ = new views::View(); |
| 115 UpdateAccountList(); | 115 UpdateAccountList(); |
| 116 scroll_content()->AddChildView(account_list_); | 116 scroll_content()->AddChildView(account_list_); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void AccountsDetailedView::AddAddAccountButton() { | 119 void AccountsDetailedView::AddAddAccountButton() { |
| 120 SessionStateDelegate* session_state_delegate = | 120 SessionStateDelegate* session_state_delegate = |
| 121 Shell::GetInstance()->session_state_delegate(); | 121 Shell::GetInstance()->session_state_delegate(); |
| 122 HoverHighlightView* add_account_button = new HoverHighlightView(this); | 122 HoverHighlightView* add_account_button = new HoverHighlightView(this); |
| 123 const UserInfo* user_info = session_state_delegate->GetUserInfo(0); | 123 const user_manager::UserInfo* user_info = |
| 124 session_state_delegate->GetUserInfo(0); |
| 124 base::string16 user_name = user_info->GetGivenName(); | 125 base::string16 user_name = user_info->GetGivenName(); |
| 125 if (user_name.empty()) | 126 if (user_name.empty()) |
| 126 user_name = user_info->GetDisplayName(); | 127 user_name = user_info->GetDisplayName(); |
| 127 if (user_name.empty()) | 128 if (user_name.empty()) |
| 128 user_name = base::ASCIIToUTF16(user_info->GetEmail()); | 129 user_name = base::ASCIIToUTF16(user_info->GetEmail()); |
| 129 add_account_button->AddLabel( | 130 add_account_button->AddLabel( |
| 130 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_ADD_ACCOUNT_LABEL, | 131 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_ADD_ACCOUNT_LABEL, |
| 131 user_name), | 132 user_name), |
| 132 gfx::ALIGN_CENTER, | 133 gfx::ALIGN_CENTER, |
| 133 gfx::Font::NORMAL); | 134 gfx::Font::NORMAL); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 views::Button::STATE_HOVERED, | 226 views::Button::STATE_HOVERED, |
| 226 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia()); | 227 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia()); |
| 227 delete_button->SetImage( | 228 delete_button->SetImage( |
| 228 views::Button::STATE_PRESSED, | 229 views::Button::STATE_PRESSED, |
| 229 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia()); | 230 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia()); |
| 230 return delete_button; | 231 return delete_button; |
| 231 } | 232 } |
| 232 | 233 |
| 233 } // namespace tray | 234 } // namespace tray |
| 234 } // namespace ash | 235 } // namespace ash |
| OLD | NEW |