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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ProfileHelper::GetProfilePathByUserIdHash((*it)->username_hash())); | 54 ProfileHelper::GetProfilePathByUserIdHash((*it)->username_hash())); |
55 | 55 |
56 gfx::Image icon = gfx::Image((*it)->GetImage()); | 56 gfx::Image icon = gfx::Image((*it)->GetImage()); |
57 if (!switches::IsNewProfileManagement() && !icon.IsEmpty()) { | 57 if (!switches::IsNewProfileManagement() && !icon.IsEmpty()) { |
58 // old avatar menu uses resized-small images | 58 // old avatar menu uses resized-small images |
59 icon = profiles::GetAvatarIconForMenu(icon, true); | 59 icon = profiles::GetAvatarIconForMenu(icon, true); |
60 } | 60 } |
61 | 61 |
62 AvatarMenu::Item* item = new AvatarMenu::Item(i, i, icon); | 62 AvatarMenu::Item* item = new AvatarMenu::Item(i, i, icon); |
63 item->name = (*it)->GetDisplayName(); | 63 item->name = (*it)->GetDisplayName(); |
64 item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); | 64 item->username = profile_info_->GetUserNameOfProfileAtIndex(i); |
65 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); | 65 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); |
66 DCHECK(!profile_info_->ProfileIsLegacySupervisedAtIndex(i)); | 66 DCHECK(!profile_info_->ProfileIsLegacySupervisedAtIndex(i)); |
67 item->legacy_supervised = false; | 67 item->legacy_supervised = false; |
68 item->child_account = profile_info_->ProfileIsChildAtIndex(i); | 68 item->child_account = profile_info_->ProfileIsChildAtIndex(i); |
69 item->signed_in = true; | 69 item->signed_in = true; |
70 item->active = profile_info_->GetPathOfProfileAtIndex(i) == | 70 item->active = profile_info_->GetPathOfProfileAtIndex(i) == |
71 active_profile_path_; | 71 active_profile_path_; |
72 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); | 72 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); |
73 items_.push_back(item); | 73 items_.push_back(item); |
74 } | 74 } |
(...skipping 27 matching lines...) Expand all Loading... |
102 void ProfileListChromeOS::ClearMenu() { | 102 void ProfileListChromeOS::ClearMenu() { |
103 STLDeleteElements(&items_); | 103 STLDeleteElements(&items_); |
104 } | 104 } |
105 | 105 |
106 void ProfileListChromeOS::SortMenu() { | 106 void ProfileListChromeOS::SortMenu() { |
107 // Sort list of items by name. | 107 // Sort list of items by name. |
108 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems); | 108 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems); |
109 } | 109 } |
110 | 110 |
111 } // namespace chromeos | 111 } // namespace chromeos |
OLD | NEW |