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

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

Issue 1289413003: Switch global error menu icon to vectorized MD asset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kick signin error service on mac Created 5 years, 3 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 "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"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" 12 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
13 #include "grit/theme_resources.h" 13 #include "grit/theme_resources.h"
14 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/canvas.h" 15 #include "ui/gfx/canvas.h"
16 #include "ui/gfx/geometry/vector2d.h" 16 #include "ui/gfx/geometry/vector2d.h"
17 #include "ui/gfx/paint_vector_icon.h" 17 #include "ui/gfx/paint_vector_icon.h"
18 #include "ui/gfx/vector_icons_public.h" 18 #include "ui/gfx/vector_icons_public.h"
19 #include "ui/native_theme/common_theme.h"
20 #include "ui/native_theme/native_theme.h"
19 #include "ui/views/border.h" 21 #include "ui/views/border.h"
20 #include "ui/views/controls/button/label_button_border.h" 22 #include "ui/views/controls/button/label_button_border.h"
21 #include "ui/views/painter.h" 23 #include "ui/views/painter.h"
22 24
23 namespace { 25 namespace {
24 26
25 scoped_ptr<views::Border> CreateBorder(const int normal_image_set[], 27 scoped_ptr<views::Border> CreateBorder(const int normal_image_set[],
26 const int hot_image_set[], 28 const int hot_image_set[],
27 const int pushed_image_set[]) { 29 const int pushed_image_set[]) {
28 scoped_ptr<views::LabelButtonAssetBorder> border( 30 scoped_ptr<views::LabelButtonAssetBorder> border(
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 ? gfx::ShadowValues() 203 ? gfx::ShadowValues()
202 : gfx::ShadowValues( 204 : gfx::ShadowValues(
203 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY))); 205 10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY)));
204 206
205 // We want the button to resize if the new text is shorter. 207 // We want the button to resize if the new text is shorter.
206 SetMinSize(gfx::Size()); 208 SetMinSize(gfx::Size());
207 209
208 if (use_generic_button) { 210 if (use_generic_button) {
209 SetImage(views::Button::STATE_NORMAL, generic_avatar_); 211 SetImage(views::Button::STATE_NORMAL, generic_avatar_);
210 } else if (has_auth_error_) { 212 } else if (has_auth_error_) {
211 // TODO(estade): revisit this color. 213 SkColor icon_color;
214 ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_Amber, &icon_color);
212 SetImage(views::Button::STATE_NORMAL, 215 SetImage(views::Button::STATE_NORMAL,
213 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, 216 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 13, icon_color));
214 SkColorSetRGB(0xFF, 0xC6, 0x1E)));
215 } else { 217 } else {
216 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); 218 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia());
217 } 219 }
218 220
219 // If we are not using the generic button, then reset the spacing between 221 // If we are not using the generic button, then reset the spacing between
220 // the text and the possible authentication error icon. 222 // the text and the possible authentication error icon.
221 const int kDefaultImageTextSpacing = 5; 223 const int kDefaultImageTextSpacing = 5;
222 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); 224 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing);
223 225
224 PreferredSizeChanged(); 226 PreferredSizeChanged();
225 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698