| OLD | NEW |
| 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 "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); | 191 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); |
| 192 | 192 |
| 193 // We want the button to resize if the new text is shorter. | 193 // We want the button to resize if the new text is shorter. |
| 194 SetMinSize(gfx::Size()); | 194 SetMinSize(gfx::Size()); |
| 195 | 195 |
| 196 if (use_generic_button) { | 196 if (use_generic_button) { |
| 197 SetImage(views::Button::STATE_NORMAL, generic_avatar_); | 197 SetImage(views::Button::STATE_NORMAL, generic_avatar_); |
| 198 } else if (error_controller_.HasAvatarError()) { | 198 } else if (error_controller_.HasAvatarError()) { |
| 199 if (switches::IsMaterialDesignUserMenu()) { | 199 if (switches::IsMaterialDesignUserMenu()) { |
| 200 SetImage(views::Button::STATE_NORMAL, | 200 SetImage(views::Button::STATE_NORMAL, |
| 201 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 13, | 201 gfx::CreateVectorIcon(gfx::VectorIconId::SYNC_PROBLEM, 16, |
| 202 gfx::kGoogleRed700)); | 202 gfx::kGoogleRed700)); |
| 203 } else { | 203 } else { |
| 204 SetImage(views::Button::STATE_NORMAL, | 204 SetImage(views::Button::STATE_NORMAL, |
| 205 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, | 205 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, |
| 206 gfx::kGoogleYellow700)); | 206 gfx::kGoogleYellow700)); |
| 207 } | 207 } |
| 208 } else { | 208 } else { |
| 209 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); | 209 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // If we are not using the generic button, then reset the spacing between | 212 // If we are not using the generic button, then reset the spacing between |
| 213 // the text and the possible authentication error icon. | 213 // the text and the possible authentication error icon. |
| 214 const int kDefaultImageTextSpacing = 5; | 214 const int kDefaultImageTextSpacing = 5; |
| 215 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 215 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
| 216 | 216 |
| 217 PreferredSizeChanged(); | 217 PreferredSizeChanged(); |
| 218 delegate_->ButtonPreferredSizeChanged(); | 218 delegate_->ButtonPreferredSizeChanged(); |
| 219 } | 219 } |
| OLD | NEW |