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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view.cc

Issue 171523004: Stop using the old-style profile names when using --new-profile-management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved new tests behind no-android/no-cros ifdef Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/frame/browser_non_client_frame_view.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/avatar_menu.h" 8 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 void BrowserNonClientFrameView::UpdateNewStyleAvatarInfo( 141 void BrowserNonClientFrameView::UpdateNewStyleAvatarInfo(
142 views::ButtonListener* listener, 142 views::ButtonListener* listener,
143 const NewAvatarButton::AvatarButtonStyle style) { 143 const NewAvatarButton::AvatarButtonStyle style) {
144 DCHECK(switches::IsNewProfileManagement()); 144 DCHECK(switches::IsNewProfileManagement());
145 // This should never be called in incognito mode. 145 // This should never be called in incognito mode.
146 DCHECK(browser_view_->IsRegularOrGuestSession()); 146 DCHECK(browser_view_->IsRegularOrGuestSession());
147 147
148 if (browser_view_->ShouldShowAvatar()) { 148 if (browser_view_->ShouldShowAvatar()) {
149 if (!new_avatar_button_) { 149 if (!new_avatar_button_) {
150 base::string16 profile_name = 150 base::string16 profile_name = profiles::GetAvatarNameForProfile(
151 profiles::GetActiveProfileDisplayName(browser_view_->browser()); 151 browser_view_->browser()->profile());
152 new_avatar_button_ = new NewAvatarButton( 152 new_avatar_button_ = new NewAvatarButton(
153 listener, profile_name, style, browser_view_->browser()); 153 listener, profile_name, style, browser_view_->browser());
154 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); 154 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON);
155 AddChildView(new_avatar_button_); 155 AddChildView(new_avatar_button_);
156 frame_->GetRootView()->Layout(); 156 frame_->GetRootView()->Layout();
157 } 157 }
158 } else if (new_avatar_button_) { 158 } else if (new_avatar_button_) {
159 delete new_avatar_button_; 159 delete new_avatar_button_;
160 new_avatar_button_ = NULL; 160 new_avatar_button_ = NULL;
161 frame_->GetRootView()->Layout(); 161 frame_->GetRootView()->Layout();
162 } 162 }
163 } 163 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm ('k') | chrome/browser/ui/views/new_avatar_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698