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 "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/browser/profiles/profiles_state.h" | 10 #include "chrome/browser/profiles/profiles_state.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 ? gfx::ShadowValues() | 202 ? gfx::ShadowValues() |
203 : gfx::ShadowValues( | 203 : gfx::ShadowValues( |
204 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); | 204 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); |
205 | 205 |
206 // We want the button to resize if the new text is shorter. | 206 // We want the button to resize if the new text is shorter. |
207 SetMinSize(gfx::Size()); | 207 SetMinSize(gfx::Size()); |
208 | 208 |
209 if (use_generic_button) { | 209 if (use_generic_button) { |
210 SetImage(views::Button::STATE_NORMAL, generic_avatar_); | 210 SetImage(views::Button::STATE_NORMAL, generic_avatar_); |
211 } else if (has_auth_error_) { | 211 } else if (has_auth_error_) { |
212 SetImage( | 212 SetImage(views::Button::STATE_NORMAL, |
213 views::Button::STATE_NORMAL, | 213 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, |
214 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, gfx::kAmber)); | 214 gfx::kGoogleYellow700)); |
215 } else { | 215 } else { |
216 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); | 216 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); |
217 } | 217 } |
218 | 218 |
219 // If we are not using the generic button, then reset the spacing between | 219 // If we are not using the generic button, then reset the spacing between |
220 // the text and the possible authentication error icon. | 220 // the text and the possible authentication error icon. |
221 const int kDefaultImageTextSpacing = 5; | 221 const int kDefaultImageTextSpacing = 5; |
222 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 222 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
223 | 223 |
224 PreferredSizeChanged(); | 224 PreferredSizeChanged(); |
225 } | 225 } |
OLD | NEW |