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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1018003002: Fast user switcher: Add "(Supervised)" label for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/views/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index); 1285 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index);
1286 const int kSmallImageSide = 32; 1286 const int kSmallImageSide = 32;
1287 1287
1288 // Use the low-res, small default avatars in the fast user switcher, like 1288 // Use the low-res, small default avatars in the fast user switcher, like
1289 // we do in the menu bar. 1289 // we do in the menu bar.
1290 gfx::Image item_icon; 1290 gfx::Image item_icon;
1291 bool is_rectangle; 1291 bool is_rectangle;
1292 AvatarMenu::GetImageForMenuButton( 1292 AvatarMenu::GetImageForMenuButton(
1293 item.profile_path, &item_icon, &is_rectangle); 1293 item.profile_path, &item_icon, &is_rectangle);
1294 1294
1295 base::string16 title = item.name;
1296 if (item.supervised) {
1297 title = l10n_util::GetStringFUTF16(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL,
msw 2015/03/18 17:15:03 nit q: should this be truncated, like in GetAvatar
Marc Treib 2015/03/18 18:12:02 No, I don't think we explicitly need to truncate h
1298 title);
1299 }
1300
1295 gfx::Image image = profiles::GetSizedAvatarIcon( 1301 gfx::Image image = profiles::GetSizedAvatarIcon(
1296 item_icon, true, kSmallImageSide, kSmallImageSide); 1302 item_icon, true, kSmallImageSide, kSmallImageSide);
1297 1303
1298 views::LabelButton* button = new BackgroundColorHoverButton( 1304 views::LabelButton* button = new BackgroundColorHoverButton(
1299 this, 1305 this,
1300 item.name, 1306 title,
1301 *image.ToImageSkia()); 1307 *image.ToImageSkia());
1302 open_other_profile_indexes_map_[button] = index; 1308 open_other_profile_indexes_map_[button] = index;
1303 1309
1304 layout->StartRow(1, 0); 1310 layout->StartRow(1, 0);
1305 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); 1311 layout->AddView(new views::Separator(views::Separator::HORIZONTAL));
1306 layout->StartRow(1, 0); 1312 layout->StartRow(1, 0);
1307 layout->AddView(button); 1313 layout->AddView(button);
1308 } 1314 }
1309 1315
1310 return view; 1316 return view;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1719 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1714 IncognitoModePrefs::DISABLED; 1720 IncognitoModePrefs::DISABLED;
1715 return incognito_available && !browser_->profile()->IsGuestSession(); 1721 return incognito_available && !browser_->profile()->IsGuestSession();
1716 } 1722 }
1717 1723
1718 void ProfileChooserView::PostActionPerformed( 1724 void ProfileChooserView::PostActionPerformed(
1719 ProfileMetrics::ProfileDesktopMenu action_performed) { 1725 ProfileMetrics::ProfileDesktopMenu action_performed) {
1720 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1726 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1721 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1727 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1722 } 1728 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698