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" | 9 #include "base/win/windows_version.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/profiles/profile_attributes_entry.h" | 12 #include "chrome/browser/profiles/profile_attributes_entry.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/profiles/profiles_state.h" | 14 #include "chrome/browser/profiles/profiles_state.h" |
15 #include "chrome/browser/ui/views/profiles/avatar_button_delegate.h" | 15 #include "chrome/browser/ui/views/profiles/avatar_button_delegate.h" |
16 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 16 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
17 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
18 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
20 #include "ui/gfx/color_palette.h" | 20 #include "ui/gfx/color_palette.h" |
21 #include "ui/gfx/geometry/vector2d.h" | 21 #include "ui/gfx/geometry/vector2d.h" |
22 #include "ui/gfx/paint_vector_icon.h" | 22 #include "ui/gfx/paint_vector_icon.h" |
23 #include "ui/gfx/vector_icons_public.h" | 23 #include "ui/gfx/vector_icons_public.h" |
24 #include "ui/views/border.h" | 24 #include "ui/views/border.h" |
25 #include "ui/views/controls/button/label_button_border.h" | 25 #include "ui/views/controls/button/label_button_border.h" |
26 #include "ui/views/painter.h" | 26 #include "ui/views/painter.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 scoped_ptr<views::Border> CreateBorder(const int normal_image_set[], | 30 std::unique_ptr<views::Border> CreateBorder(const int normal_image_set[], |
31 const int hot_image_set[], | 31 const int hot_image_set[], |
32 const int pushed_image_set[]) { | 32 const int pushed_image_set[]) { |
33 scoped_ptr<views::LabelButtonAssetBorder> border( | 33 std::unique_ptr<views::LabelButtonAssetBorder> border( |
34 new views::LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON)); | 34 new views::LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON)); |
35 border->SetPainter(false, views::Button::STATE_NORMAL, | 35 border->SetPainter(false, views::Button::STATE_NORMAL, |
36 views::Painter::CreateImageGridPainter(normal_image_set)); | 36 views::Painter::CreateImageGridPainter(normal_image_set)); |
37 border->SetPainter(false, views::Button::STATE_HOVERED, | 37 border->SetPainter(false, views::Button::STATE_HOVERED, |
38 views::Painter::CreateImageGridPainter(hot_image_set)); | 38 views::Painter::CreateImageGridPainter(hot_image_set)); |
39 border->SetPainter(false, views::Button::STATE_PRESSED, | 39 border->SetPainter(false, views::Button::STATE_PRESSED, |
40 views::Painter::CreateImageGridPainter(pushed_image_set)); | 40 views::Painter::CreateImageGridPainter(pushed_image_set)); |
41 | 41 |
42 const int kLeftRightInset = 8; | 42 const int kLeftRightInset = 8; |
43 const int kTopInset = 2; | 43 const int kTopInset = 2; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 223 } |
224 | 224 |
225 // If we are not using the generic button, then reset the spacing between | 225 // If we are not using the generic button, then reset the spacing between |
226 // the text and the possible authentication error icon. | 226 // the text and the possible authentication error icon. |
227 const int kDefaultImageTextSpacing = 5; | 227 const int kDefaultImageTextSpacing = 5; |
228 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 228 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
229 | 229 |
230 PreferredSizeChanged(); | 230 PreferredSizeChanged(); |
231 delegate_->ButtonPreferredSizeChanged(); | 231 delegate_->ButtonPreferredSizeChanged(); |
232 } | 232 } |
OLD | NEW |