| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 if (button_style == THEMED_BUTTON) { | 73 if (button_style == THEMED_BUTTON) { |
| 74 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL); | 74 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL); |
| 75 const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_HOVER); | 75 const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_HOVER); |
| 76 const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_PRESSED); | 76 const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_PRESSED); |
| 77 | 77 |
| 78 SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); | 78 SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); |
| 79 generic_avatar_ = | 79 generic_avatar_ = |
| 80 *rb->GetImageNamed(IDR_AVATAR_THEMED_BUTTON_AVATAR).ToImageSkia(); | 80 *rb->GetImageNamed(IDR_AVATAR_THEMED_BUTTON_AVATAR).ToImageSkia(); |
| 81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 82 } else if (base::win::GetVersion() >= base::win::VERSION_WIN8 || | 82 } else if (base::win::GetVersion() >= base::win::VERSION_WIN8 || |
| 83 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { | 83 browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_ASH) { |
| 84 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_NORMAL); | 84 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_NORMAL); |
| 85 const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_HOVER); | 85 const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_HOVER); |
| 86 const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_PRESSED); | 86 const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_PRESSED); |
| 87 | 87 |
| 88 SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); | 88 SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); |
| 89 generic_avatar_ = | 89 generic_avatar_ = |
| 90 *rb->GetImageNamed(IDR_AVATAR_METRO_BUTTON_AVATAR).ToImageSkia(); | 90 *rb->GetImageNamed(IDR_AVATAR_METRO_BUTTON_AVATAR).ToImageSkia(); |
| 91 #endif | 91 #endif |
| 92 } else { | 92 } else { |
| 93 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_GLASS_BUTTON_NORMAL); | 93 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_GLASS_BUTTON_NORMAL); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); | 218 SetImage(views::Button::STATE_NORMAL, gfx::ImageSkia()); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // 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 |
| 222 // the text and the possible authentication error icon. | 222 // the text and the possible authentication error icon. |
| 223 const int kDefaultImageTextSpacing = 5; | 223 const int kDefaultImageTextSpacing = 5; |
| 224 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 224 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
| 225 | 225 |
| 226 PreferredSizeChanged(); | 226 PreferredSizeChanged(); |
| 227 } | 227 } |
| OLD | NEW |