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

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

Issue 2237023002: [MD User Menu] Adjusted the size and position of avatar button icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm ('k') | no next file » | 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 "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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698