| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/profiles/profile_list_chromeos.h" | 5 #include "chrome/browser/chromeos/profiles/profile_list_chromeos.h" |
| 6 | 6 |
| 7 #include <unordered_map> | 7 #include <unordered_map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (user_index_it == user_indices_by_path.end()) | 67 if (user_index_it == user_indices_by_path.end()) |
| 68 continue; | 68 continue; |
| 69 user_manager::User* user = users[user_index_it->second]; | 69 user_manager::User* user = users[user_index_it->second]; |
| 70 | 70 |
| 71 gfx::Image icon = gfx::Image(user->GetImage()); | 71 gfx::Image icon = gfx::Image(user->GetImage()); |
| 72 if (!switches::IsNewProfileManagement() && !icon.IsEmpty()) { | 72 if (!switches::IsNewProfileManagement() && !icon.IsEmpty()) { |
| 73 // old avatar menu uses resized-small images | 73 // old avatar menu uses resized-small images |
| 74 icon = profiles::GetAvatarIconForMenu(icon, true); | 74 icon = profiles::GetAvatarIconForMenu(icon, true); |
| 75 } | 75 } |
| 76 | 76 |
| 77 scoped_ptr<AvatarMenu::Item> item( | 77 std::unique_ptr<AvatarMenu::Item> item( |
| 78 new AvatarMenu::Item(items_.size(), entry->GetPath(), icon)); | 78 new AvatarMenu::Item(items_.size(), entry->GetPath(), icon)); |
| 79 item->name = user->GetDisplayName(); | 79 item->name = user->GetDisplayName(); |
| 80 item->username = entry->GetUserName(); | 80 item->username = entry->GetUserName(); |
| 81 DCHECK(!entry->IsLegacySupervised()); | 81 DCHECK(!entry->IsLegacySupervised()); |
| 82 item->legacy_supervised = false; | 82 item->legacy_supervised = false; |
| 83 item->child_account = entry->IsChild(); | 83 item->child_account = entry->IsChild(); |
| 84 item->signed_in = true; | 84 item->signed_in = true; |
| 85 item->active = item->profile_path == active_profile_path_; | 85 item->active = item->profile_path == active_profile_path_; |
| 86 item->signin_required = entry->IsSigninRequired(); | 86 item->signin_required = entry->IsSigninRequired(); |
| 87 items_.push_back(std::move(item)); | 87 items_.push_back(std::move(item)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 102 // up in the model as a logged-in user. In that case, we return 0. | 102 // up in the model as a logged-in user. In that case, we return 0. |
| 103 return 0; | 103 return 0; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void ProfileListChromeOS::ActiveProfilePathChanged( | 106 void ProfileListChromeOS::ActiveProfilePathChanged( |
| 107 const base::FilePath& active_profile_path) { | 107 const base::FilePath& active_profile_path) { |
| 108 active_profile_path_ = active_profile_path; | 108 active_profile_path_ = active_profile_path; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace chromeos | 111 } // namespace chromeos |
| OLD | NEW |