| 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/avatar_button.h" | 5 #include "chrome/browser/ui/views/profiles/avatar_button.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/app/vector_icons/vector_icons.h" | 9 #include "chrome/app/vector_icons/vector_icons.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 bool apply_ink_drop = IsCondensible(); | 194 bool apply_ink_drop = IsCondensible(); |
| 195 #if defined(OS_LINUX) | 195 #if defined(OS_LINUX) |
| 196 DCHECK_EQ(AvatarButtonStyle::THEMED, button_style); | 196 DCHECK_EQ(AvatarButtonStyle::THEMED, button_style); |
| 197 apply_ink_drop = true; | 197 apply_ink_drop = true; |
| 198 #endif | 198 #endif |
| 199 | 199 |
| 200 if (apply_ink_drop) { | 200 if (apply_ink_drop) { |
| 201 SetInkDropMode(InkDropMode::ON); | 201 SetInkDropMode(InkDropMode::ON); |
| 202 SetFocusPainter(nullptr); | 202 SetFocusPainter(nullptr); |
| 203 #if defined(OS_LINUX) |
| 203 constexpr int kIconSize = 16; | 204 constexpr int kIconSize = 16; |
| 204 #if defined(OS_LINUX) | |
| 205 set_ink_drop_base_color(SK_ColorWHITE); | 205 set_ink_drop_base_color(SK_ColorWHITE); |
| 206 SetBorder(base::MakeUnique<AvatarButtonThemedBorder>()); | 206 SetBorder(base::MakeUnique<AvatarButtonThemedBorder>()); |
| 207 generic_avatar_ = gfx::CreateVectorIcon(kProfileSwitcherOutlineIcon, | 207 generic_avatar_ = gfx::CreateVectorIcon(kProfileSwitcherOutlineIcon, |
| 208 kIconSize, gfx::kPlaceholderColor); | 208 kIconSize, gfx::kPlaceholderColor); |
| 209 #elif defined(OS_WIN) | 209 #elif defined(OS_WIN) |
| 210 constexpr int kIconSize = 16; |
| 210 DCHECK_EQ(AvatarButtonStyle::NATIVE, button_style); | 211 DCHECK_EQ(AvatarButtonStyle::NATIVE, button_style); |
| 211 set_ink_drop_base_color(SK_ColorBLACK); | 212 set_ink_drop_base_color(SK_ColorBLACK); |
| 212 SetBorder(views::CreateEmptyBorder(kBorderInsets)); | 213 SetBorder(views::CreateEmptyBorder(kBorderInsets)); |
| 213 constexpr SkColor kIconColor = | 214 constexpr SkColor kIconColor = |
| 214 SkColorSetA(SK_ColorBLACK, static_cast<SkAlpha>(0.54 * 0xFF)); | 215 SkColorSetA(SK_ColorBLACK, static_cast<SkAlpha>(0.54 * 0xFF)); |
| 215 generic_avatar_ = | 216 generic_avatar_ = |
| 216 gfx::CreateVectorIcon(kAccountCircleIcon, kIconSize, kIconColor); | 217 gfx::CreateVectorIcon(kAccountCircleIcon, kIconSize, kIconColor); |
| 217 #endif // defined(OS_WIN) | 218 #endif // defined(OS_WIN) |
| 218 } else if (button_style == AvatarButtonStyle::THEMED) { | 219 } else if (button_style == AvatarButtonStyle::THEMED) { |
| 219 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL); | 220 const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 431 |
| 431 // TODO(estade): all versions of this button should condense. | 432 // TODO(estade): all versions of this button should condense. |
| 432 bool AvatarButton::IsCondensible() const { | 433 bool AvatarButton::IsCondensible() const { |
| 433 #if defined(OS_WIN) | 434 #if defined(OS_WIN) |
| 434 return (base::win::GetVersion() >= base::win::VERSION_WIN10) && | 435 return (base::win::GetVersion() >= base::win::VERSION_WIN10) && |
| 435 button_style_ == AvatarButtonStyle::NATIVE; | 436 button_style_ == AvatarButtonStyle::NATIVE; |
| 436 #else | 437 #else |
| 437 return false; | 438 return false; |
| 438 #endif | 439 #endif |
| 439 } | 440 } |
| OLD | NEW |