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

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

Issue 598163002: [Win] Redesign the new avatar button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move static var declaration Created 6 years, 2 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
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_avatar_icon_util.h" 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 void BrowserNonClientFrameView::UpdateNewStyleAvatarInfo( 140 void BrowserNonClientFrameView::UpdateNewStyleAvatarInfo(
141 views::ButtonListener* listener, 141 views::ButtonListener* listener,
142 const NewAvatarButton::AvatarButtonStyle style) { 142 const NewAvatarButton::AvatarButtonStyle style) {
143 DCHECK(switches::IsNewAvatarMenu()); 143 DCHECK(switches::IsNewAvatarMenu());
144 // This should never be called in incognito mode. 144 // This should never be called in incognito mode.
145 DCHECK(browser_view_->IsRegularOrGuestSession()); 145 DCHECK(browser_view_->IsRegularOrGuestSession());
146 146
147 if (browser_view_->ShouldShowAvatar()) { 147 if (browser_view_->ShouldShowAvatar()) {
148 if (!new_avatar_button_) { 148 if (!new_avatar_button_) {
149 base::string16 profile_name = profiles::GetAvatarNameForProfile( 149 new_avatar_button_ =
150 browser_view_->browser()->profile()->GetPath()); 150 new NewAvatarButton(listener, style, browser_view_->browser());
151 new_avatar_button_ = new NewAvatarButton(
152 listener, profile_name, style, browser_view_->browser());
153 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); 151 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON);
154 AddChildView(new_avatar_button_); 152 AddChildView(new_avatar_button_);
155 frame_->GetRootView()->Layout(); 153 frame_->GetRootView()->Layout();
156 } 154 }
157 } else if (new_avatar_button_) { 155 } else if (new_avatar_button_) {
158 delete new_avatar_button_; 156 delete new_avatar_button_;
159 new_avatar_button_ = NULL; 157 new_avatar_button_ = NULL;
160 frame_->GetRootView()->Layout(); 158 frame_->GetRootView()->Layout();
161 } 159 }
162 } 160 }
OLDNEW
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/ui/views/frame/glass_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698