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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/win/windows_version.h" | |
10 #include "build/build_config.h" | 9 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/profiles/profile_attributes_entry.h" | 11 #include "chrome/browser/profiles/profile_attributes_entry.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
15 #include "chrome/browser/ui/views/profiles/avatar_button_delegate.h" | 14 #include "chrome/browser/ui/views/profiles/avatar_button_delegate.h" |
16 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 15 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
17 #include "chrome/grit/theme_resources.h" | 16 #include "chrome/grit/theme_resources.h" |
18 #include "components/signin/core/common/profile_management_switches.h" | 17 #include "components/signin/core/common/profile_management_switches.h" |
19 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
21 #include "ui/gfx/color_palette.h" | 20 #include "ui/gfx/color_palette.h" |
22 #include "ui/gfx/geometry/vector2d.h" | 21 #include "ui/gfx/geometry/vector2d.h" |
23 #include "ui/gfx/paint_vector_icon.h" | 22 #include "ui/gfx/paint_vector_icon.h" |
24 #include "ui/gfx/vector_icons_public.h" | 23 #include "ui/gfx/vector_icons_public.h" |
25 #include "ui/views/border.h" | 24 #include "ui/views/border.h" |
26 #include "ui/views/controls/button/label_button_border.h" | 25 #include "ui/views/controls/button/label_button_border.h" |
27 #include "ui/views/painter.h" | 26 #include "ui/views/painter.h" |
28 | 27 |
| 28 #if defined(OS_WIN) |
| 29 #include "base/win/windows_version.h" |
| 30 #endif |
| 31 |
29 namespace { | 32 namespace { |
30 | 33 |
31 std::unique_ptr<views::Border> CreateBorder(const int normal_image_set[], | 34 std::unique_ptr<views::Border> CreateBorder(const int normal_image_set[], |
32 const int hot_image_set[], | 35 const int hot_image_set[], |
33 const int pushed_image_set[]) { | 36 const int pushed_image_set[]) { |
34 std::unique_ptr<views::LabelButtonAssetBorder> border( | 37 std::unique_ptr<views::LabelButtonAssetBorder> border( |
35 new views::LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON)); | 38 new views::LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON)); |
36 border->SetPainter(false, views::Button::STATE_NORMAL, | 39 border->SetPainter(false, views::Button::STATE_NORMAL, |
37 views::Painter::CreateImageGridPainter(normal_image_set)); | 40 views::Painter::CreateImageGridPainter(normal_image_set)); |
38 border->SetPainter(false, views::Button::STATE_HOVERED, | 41 border->SetPainter(false, views::Button::STATE_HOVERED, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 214 } |
212 | 215 |
213 // If we are not using the generic button, then reset the spacing between | 216 // If we are not using the generic button, then reset the spacing between |
214 // the text and the possible authentication error icon. | 217 // the text and the possible authentication error icon. |
215 const int kDefaultImageTextSpacing = 5; | 218 const int kDefaultImageTextSpacing = 5; |
216 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 219 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
217 | 220 |
218 PreferredSizeChanged(); | 221 PreferredSizeChanged(); |
219 delegate_->ButtonPreferredSizeChanged(); | 222 delegate_->ButtonPreferredSizeChanged(); |
220 } | 223 } |
OLD | NEW |