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

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

Issue 2649133008: Remove another use of old CreateShadowDrawLooper. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | ui/gfx/render_text.cc » ('j') | 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/new_avatar_button.h" 5 #include "chrome/browser/ui/views/profiles/new_avatar_button.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 SetText(use_generic_button 185 SetText(use_generic_button
186 ? base::string16() 186 ? base::string16()
187 : profiles::GetAvatarButtonTextForProfile(profile_)); 187 : profiles::GetAvatarButtonTextForProfile(profile_));
188 188
189 // If the button has no text, clear the text shadows to make sure the 189 // If the button has no text, clear the text shadows to make sure the
190 // image is centered correctly. 190 // image is centered correctly.
191 SetTextShadows( 191 SetTextShadows(
192 use_generic_button 192 use_generic_button
193 ? gfx::ShadowValues() 193 ? gfx::ShadowValues()
194 : gfx::ShadowValues( 194 : gfx::ShadowValues(
195 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); 195 10, gfx::ShadowValue(gfx::Vector2d(), 2.0f, SK_ColorDKGRAY)));
196 196
197 // We want the button to resize if the new text is shorter. 197 // We want the button to resize if the new text is shorter.
198 SetMinSize(gfx::Size()); 198 SetMinSize(gfx::Size());
199 199
200 if (use_generic_button) { 200 if (use_generic_button) {
201 SetImage(views::Button::STATE_NORMAL, generic_avatar_); 201 SetImage(views::Button::STATE_NORMAL, generic_avatar_);
202 } else if (error_controller_.HasAvatarError()) { 202 } else if (error_controller_.HasAvatarError()) {
203 if (switches::IsMaterialDesignUserMenu()) { 203 if (switches::IsMaterialDesignUserMenu()) {
204 SetImage(views::Button::STATE_NORMAL, 204 SetImage(views::Button::STATE_NORMAL,
205 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 16, 205 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 16,
206 gfx::kGoogleRed700)); 206 gfx::kGoogleRed700));
207 } else { 207 } else {
208 SetImage(views::Button::STATE_NORMAL, 208 SetImage(views::Button::STATE_NORMAL,
209 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, 209 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13,
210 gfx::kGoogleYellow700)); 210 gfx::kGoogleYellow700));
211 } 211 }
212 } else { 212 } else {
213 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); 213 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia());
214 } 214 }
215 215
216 // If we are not using the generic button, then reset the spacing between 216 // If we are not using the generic button, then reset the spacing between
217 // the text and the possible authentication error icon. 217 // the text and the possible authentication error icon.
218 const int kDefaultImageTextSpacing = 5; 218 const int kDefaultImageTextSpacing = 5;
219 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); 219 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing);
220 220
221 PreferredSizeChanged(); 221 PreferredSizeChanged();
222 delegate_->ButtonPreferredSizeChanged(); 222 delegate_->ButtonPreferredSizeChanged();
223 } 223 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698