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

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

Issue 2708073002: Removing pre-material design menu setting. (Closed)
Patch Set: Replacing functions by variables Created 3 years, 9 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 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 ? gfx::ShadowValues() 193 ? gfx::ShadowValues()
194 : gfx::ShadowValues( 194 : gfx::ShadowValues(
195 10, gfx::ShadowValue(gfx::Vector2d(), 2.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 SetImage(views::Button::STATE_NORMAL,
204 SetImage(views::Button::STATE_NORMAL, 204 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 16,
205 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 16, 205 gfx::kGoogleRed700));
206 gfx::kGoogleRed700));
207 } else {
208 SetImage(views::Button::STATE_NORMAL,
209 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13,
210 gfx::kGoogleYellow700));
211 }
212 } else { 206 } else {
213 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); 207 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia());
214 } 208 }
215 209
216 // If we are not using the generic button, then reset the spacing between 210 // If we are not using the generic button, then reset the spacing between
217 // the text and the possible authentication error icon. 211 // the text and the possible authentication error icon.
218 const int kDefaultImageTextSpacing = 5; 212 const int kDefaultImageTextSpacing = 5;
219 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); 213 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing);
220 214
221 PreferredSizeChanged(); 215 PreferredSizeChanged();
222 delegate_->ButtonPreferredSizeChanged(); 216 delegate_->ButtonPreferredSizeChanged();
223 } 217 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698