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

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

Issue 297193003: New avatar menu: Add icon for supervised users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New resources Created 6 years, 6 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 | Annotate | Revision Log
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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 question_mark_button_->SetImage(views::ImageButton::STATE_HOVERED, 1044 question_mark_button_->SetImage(views::ImageButton::STATE_HOVERED,
1045 rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_QUESTION_HOVER)); 1045 rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_QUESTION_HOVER));
1046 question_mark_button_->SetImage(views::ImageButton::STATE_PRESSED, 1046 question_mark_button_->SetImage(views::ImageButton::STATE_PRESSED,
1047 rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_QUESTION_SELECT)); 1047 rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_QUESTION_SELECT));
1048 gfx::Size preferred_size = question_mark_button_->GetPreferredSize(); 1048 gfx::Size preferred_size = question_mark_button_->GetPreferredSize();
1049 question_mark_button_->SetBounds( 1049 question_mark_button_->SetBounds(
1050 0, 0, preferred_size.width(), preferred_size.height()); 1050 0, 0, preferred_size.width(), preferred_size.height());
1051 current_profile_photo_->AddChildView(question_mark_button_); 1051 current_profile_photo_->AddChildView(question_mark_button_);
1052 } 1052 }
1053 1053
1054 if (browser_->profile()->IsManaged()) {
1055 views::ImageView* supervised_icon = new views::ImageView();
msw 2014/06/02 21:18:15 ditto nit about consistent terminology.
1056 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
1057 supervised_icon->SetImage(
1058 rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_SUPERVISED));
1059 gfx::Size preferred_size = supervised_icon->GetPreferredSize();
1060 gfx::Rect parent_bounds = current_profile_photo_->bounds();
1061 supervised_icon->SetBounds(
1062 parent_bounds.right() - preferred_size.width(),
1063 parent_bounds.bottom() - preferred_size.height(),
1064 preferred_size.width(),
1065 preferred_size.height());
1066 current_profile_photo_->AddChildView(supervised_icon);
1067 }
1068
1054 layout->StartRow(1, 0); 1069 layout->StartRow(1, 0);
1055 layout->AddView(current_profile_photo_); 1070 layout->AddView(current_profile_photo_);
1056 1071
1057 // Profile name, centered. 1072 // Profile name, centered.
1058 bool editing_allowed = !is_guest && !browser_->profile()->IsManaged(); 1073 bool editing_allowed = !is_guest && !browser_->profile()->IsManaged();
1059 current_profile_name_ = new EditableProfileName( 1074 current_profile_name_ = new EditableProfileName(
1060 this, profiles::GetAvatarNameForProfile(browser_->profile()), 1075 this, profiles::GetAvatarNameForProfile(browser_->profile()),
1061 editing_allowed); 1076 editing_allowed);
1062 layout->StartRow(1, 0); 1077 layout->StartRow(1, 0);
1063 layout->AddView(current_profile_name_); 1078 layout->AddView(current_profile_name_);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 layout->StartRowWithPadding( 1475 layout->StartRowWithPadding(
1461 1, 0, 0, views::kUnrelatedControlVerticalSpacing); 1476 1, 0, 0, views::kUnrelatedControlVerticalSpacing);
1462 layout->AddView(end_preview_and_relaunch_button_); 1477 layout->AddView(end_preview_and_relaunch_button_);
1463 1478
1464 TitleCard* title_card = new TitleCard( 1479 TitleCard* title_card = new TitleCard(
1465 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); 1480 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_);
1466 return TitleCard::AddPaddedTitleCard( 1481 return TitleCard::AddPaddedTitleCard(
1467 view, title_card, kFixedAccountRemovalViewWidth); 1482 view, title_card, kFixedAccountRemovalViewWidth);
1468 } 1483 }
1469 1484
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698