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

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

Issue 900223004: [Mac, Win] The fast user switcher should use the small, non-high res default avatars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bad camelCase, bad Created 5 years, 10 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/browser/ui/cocoa/profiles/profile_chooser_controller.mm ('k') | 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 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 const Indexes& avatars_to_show) { 1240 const Indexes& avatars_to_show) {
1241 views::View* view = new views::View(); 1241 views::View* view = new views::View();
1242 views::GridLayout* layout = CreateSingleColumnLayout(view, kFixedMenuWidth); 1242 views::GridLayout* layout = CreateSingleColumnLayout(view, kFixedMenuWidth);
1243 1243
1244 int num_avatars_to_show = avatars_to_show.size(); 1244 int num_avatars_to_show = avatars_to_show.size();
1245 for (int i = 0; i < num_avatars_to_show; ++i) { 1245 for (int i = 0; i < num_avatars_to_show; ++i) {
1246 const size_t index = avatars_to_show[i]; 1246 const size_t index = avatars_to_show[i];
1247 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index); 1247 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index);
1248 const int kSmallImageSide = 32; 1248 const int kSmallImageSide = 32;
1249 1249
1250 // Use the low-res, small default avatars in the fast user switcher, like
1251 // we do in the menu bar.
1252 gfx::Image item_icon;
1253 bool is_rectangle;
1254 AvatarMenu::GetImageForMenuButton(
1255 item.profile_path, &item_icon, &is_rectangle);
1256
1250 gfx::Image image = profiles::GetSizedAvatarIcon( 1257 gfx::Image image = profiles::GetSizedAvatarIcon(
1251 item.icon, true, kSmallImageSide, kSmallImageSide); 1258 item_icon, true, kSmallImageSide, kSmallImageSide);
1252 1259
1253 views::LabelButton* button = new BackgroundColorHoverButton( 1260 views::LabelButton* button = new BackgroundColorHoverButton(
1254 this, 1261 this,
1255 item.name, 1262 item.name,
1256 *image.ToImageSkia()); 1263 *image.ToImageSkia());
1257 open_other_profile_indexes_map_[button] = index; 1264 open_other_profile_indexes_map_[button] = index;
1258 1265
1259 layout->StartRow(1, 0); 1266 layout->StartRow(1, 0);
1260 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); 1267 layout->AddView(new views::Separator(views::Separator::HORIZONTAL));
1261 layout->StartRow(1, 0); 1268 layout->StartRow(1, 0);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1675 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1669 IncognitoModePrefs::DISABLED; 1676 IncognitoModePrefs::DISABLED;
1670 return incognito_available && !browser_->profile()->IsGuestSession(); 1677 return incognito_available && !browser_->profile()->IsGuestSession();
1671 } 1678 }
1672 1679
1673 void ProfileChooserView::PostActionPerformed( 1680 void ProfileChooserView::PostActionPerformed(
1674 ProfileMetrics::ProfileDesktopMenu action_performed) { 1681 ProfileMetrics::ProfileDesktopMenu action_performed) {
1675 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1682 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1676 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1683 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1677 } 1684 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698