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

Side by Side Diff: chrome/browser/profiles/profile_list_desktop.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
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/profiles/profile_list_desktop.h" 5 #include "chrome/browser/profiles/profile_list_desktop.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 8 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
9 #include "chrome/browser/profiles/profile_info_cache.h" 9 #include "chrome/browser/profiles/profile_info_cache.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 continue; 44 continue;
45 } 45 }
46 46
47 gfx::Image icon = profile_info_->GetAvatarIconOfProfileAtIndex(i); 47 gfx::Image icon = profile_info_->GetAvatarIconOfProfileAtIndex(i);
48 AvatarMenu::Item* item = new AvatarMenu::Item(i - omitted_item_count_, 48 AvatarMenu::Item* item = new AvatarMenu::Item(i - omitted_item_count_,
49 i, 49 i,
50 icon); 50 icon);
51 item->name = profile_info_->GetNameOfProfileAtIndex(i); 51 item->name = profile_info_->GetNameOfProfileAtIndex(i);
52 item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); 52 item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i);
53 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); 53 item->profile_path = profile_info_->GetPathOfProfileAtIndex(i);
54 item->supervised = profile_info_->ProfileIsSupervisedAtIndex(i); 54 item->legacy_supervised =
55 profile_info_->ProfileIsLegacySupervisedAtIndex(i);
56 item->child_account = profile_info_->ProfileIsChildAtIndex(i);
55 item->signed_in = !item->sync_state.empty(); 57 item->signed_in = !item->sync_state.empty();
56 if (!item->signed_in) { 58 if (!item->signed_in) {
57 item->sync_state = l10n_util::GetStringUTF16( 59 item->sync_state = l10n_util::GetStringUTF16(
58 item->supervised ? IDS_SUPERVISED_USER_AVATAR_LABEL : 60 item->legacy_supervised ? IDS_SUPERVISED_USER_AVATAR_LABEL :
59 IDS_PROFILES_LOCAL_PROFILE_STATE); 61 IDS_PROFILES_LOCAL_PROFILE_STATE);
60 } 62 }
61 item->active = profile_info_->GetPathOfProfileAtIndex(i) == 63 item->active = profile_info_->GetPathOfProfileAtIndex(i) ==
62 active_profile_path_; 64 active_profile_path_;
63 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i); 65 item->signin_required = profile_info_->ProfileIsSigninRequiredAtIndex(i);
64 items_.push_back(item); 66 items_.push_back(item);
65 } 67 }
66 // One omitted item is expected when a supervised-user profile is in the 68 // One omitted item is expected when a supervised-user profile is in the
67 // process of being registered, but there shouldn't be more than one. 69 // process of being registered, but there shouldn't be more than one.
68 VLOG_IF(2, (omitted_item_count_ > 1)) << omitted_item_count_ 70 VLOG_IF(2, (omitted_item_count_ > 1)) << omitted_item_count_
69 << " profiles omitted fom list."; 71 << " profiles omitted fom list.";
(...skipping 20 matching lines...) Expand all
90 } 92 }
91 93
92 void ProfileListDesktop::ActiveProfilePathChanged(base::FilePath& path) { 94 void ProfileListDesktop::ActiveProfilePathChanged(base::FilePath& path) {
93 active_profile_path_ = path; 95 active_profile_path_ = path;
94 } 96 }
95 97
96 void ProfileListDesktop::ClearMenu() { 98 void ProfileListDesktop::ClearMenu() {
97 STLDeleteElements(&items_); 99 STLDeleteElements(&items_);
98 omitted_item_count_ = 0; 100 omitted_item_count_ = 0;
99 } 101 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/avatar_menu.h ('k') | chrome/browser/ui/cocoa/profiles/profile_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698