Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/chromeos/profiles/profile_list_chromeos.cc

Issue 1028603003: Fast user switcher: Distinguish supervised users from child accounts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/profiles/avatar_menu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 DCHECK(!profile_info_->ProfileIsLegacySupervisedAtIndex(i));
67 item->legacy_supervised = false;
68 item->child_account = profile_info_->ProfileIsChildAtIndex(i);
67 item->signed_in = true; 69 item->signed_in = true;
68 item->active = profile_info_->GetPathOfProfileAtIndex(i) == 70 item->active = profile_info_->GetPathOfProfileAtIndex(i) ==
69 active_profile_path_; 71 active_profile_path_;
70 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); 72 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i);
71 items_.push_back(item); 73 items_.push_back(item);
72 } 74 }
73 75
74 SortMenu(); 76 SortMenu();
75 77
76 // After sorting, assign items their actual indices. 78 // After sorting, assign items their actual indices.
(...skipping 23 matching lines...) Expand all
100 void ProfileListChromeOS::ClearMenu() { 102 void ProfileListChromeOS::ClearMenu() {
101 STLDeleteElements(&items_); 103 STLDeleteElements(&items_);
102 } 104 }
103 105
104 void ProfileListChromeOS::SortMenu() { 106 void ProfileListChromeOS::SortMenu() {
105 // Sort list of items by name. 107 // Sort list of items by name.
106 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems); 108 std::sort(items_.begin(), items_.end(), &AvatarMenu::CompareItems);
107 } 109 }
108 110
109 } // namespace chromeos 111 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/profiles/avatar_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698