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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 458893003: Fix crash in guest mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 0ab3fbba1d04c666dba53e91c3fd8732a3d75367..b2b4c72f8b9fcd367689a3e6eea1c4cc21960601 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -606,10 +606,10 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
AvatarMenu* avatar_menu) {
// The account management view should only be displayed if the active profile
// is signed in.
- const AvatarMenu::Item& active_item = avatar_menu->GetItemAt(
- avatar_menu->GetActiveProfileIndex());
if (view_to_display == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) {
DCHECK(switches::IsEnableAccountConsistency());
+ const AvatarMenu::Item& active_item = avatar_menu->GetItemAt(
+ avatar_menu->GetActiveProfileIndex());
DCHECK(active_item.signed_in);
}
@@ -641,7 +641,7 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
break;
case profiles::BUBBLE_VIEW_MODE_SWITCH_USER:
layout = CreateSingleColumnLayout(this, kFixedSwitchUserViewWidth);
- sub_view = CreateSwitchUserView(active_item);
+ sub_view = CreateSwitchUserView();
break;
default:
layout = CreateSingleColumnLayout(this, kFixedMenuWidth);
@@ -1438,8 +1438,7 @@ views::View* ProfileChooserView::CreateSigninConfirmationView(){
&tutorial_sync_settings_ok_button_);
}
-views::View* ProfileChooserView::CreateSwitchUserView(
- const AvatarMenu::Item& avatar_item) {
+views::View* ProfileChooserView::CreateSwitchUserView() {
views::View* view = new views::View();
views::GridLayout* layout = CreateSingleColumnLayout(
view, kFixedSwitchUserViewWidth);
@@ -1456,6 +1455,8 @@ views::View* ProfileChooserView::CreateSwitchUserView(
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
const gfx::FontList& small_font_list =
rb->GetFontList(ui::ResourceBundle::SmallFont);
+ const AvatarMenu::Item& avatar_item =
+ avatar_menu_->GetItemAt(avatar_menu_->GetActiveProfileIndex());
views::Label* content_label = new views::Label(
l10n_util::GetStringFUTF16(
IDS_PROFILES_NOT_YOU_CONTENT_TEXT, avatar_item.name));
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698