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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); |
65 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); | 65 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); |
66 item->supervised = false; | 66 item->legacy_supervised = false; |
msw
2015/03/23 19:28:33
Should this be using ProfileIsLegacySupervisedAtIn
Marc Treib
2015/03/24 15:03:14
On CrOS, we should never get a legacy supervised u
| |
67 item->child_account = profile_info_->ProfileIsChildAtIndex(i); | |
67 item->signed_in = true; | 68 item->signed_in = true; |
68 item->active = profile_info_->GetPathOfProfileAtIndex(i) == | 69 item->active = profile_info_->GetPathOfProfileAtIndex(i) == |
69 active_profile_path_; | 70 active_profile_path_; |
70 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); | 71 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); |
71 items_.push_back(item); | 72 items_.push_back(item); |
72 } | 73 } |
73 | 74 |
74 SortMenu(); | 75 SortMenu(); |
75 | 76 |
76 // After sorting, assign items their actual indices. | 77 // After sorting, assign items their actual indices. |
(...skipping 23 matching lines...) Expand all Loading... | |
100 void ProfileListChromeOS::ClearMenu() { | 101 void ProfileListChromeOS::ClearMenu() { |
101 STLDeleteElements(&items_); | 102 STLDeleteElements(&items_); |
102 } | 103 } |
103 | 104 |
104 void ProfileListChromeOS::SortMenu() { | 105 void ProfileListChromeOS::SortMenu() { |
105 // Sort list of items by name. | 106 // Sort list of items by name. |
106 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems); | 107 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems); |
107 } | 108 } |
108 | 109 |
109 } // namespace chromeos | 110 } // namespace chromeos |
OLD | NEW |