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 19 matching lines...) Expand all Loading... |
30 views::Painter::CreateImageGridPainter(hot_image_set)); | 30 views::Painter::CreateImageGridPainter(hot_image_set)); |
31 border->SetPainter(false, views::Button::STATE_PRESSED, | 31 border->SetPainter(false, views::Button::STATE_PRESSED, |
32 views::Painter::CreateImageGridPainter(pushed_image_set)); | 32 views::Painter::CreateImageGridPainter(pushed_image_set)); |
33 | 33 |
34 const int kLeftRightInset = 8; | 34 const int kLeftRightInset = 8; |
35 const int kTopInset = 2; | 35 const int kTopInset = 2; |
36 const int kBottomInset = 4; | 36 const int kBottomInset = 4; |
37 border->set_insets(gfx::Insets(kTopInset, kLeftRightInset, | 37 border->set_insets(gfx::Insets(kTopInset, kLeftRightInset, |
38 kBottomInset, kLeftRightInset)); | 38 kBottomInset, kLeftRightInset)); |
39 | 39 |
40 return border.PassAs<views::Border>(); | 40 return border.Pass(); |
41 } | 41 } |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 NewAvatarButton::NewAvatarButton(views::ButtonListener* listener, | 45 NewAvatarButton::NewAvatarButton(views::ButtonListener* listener, |
46 AvatarButtonStyle button_style, | 46 AvatarButtonStyle button_style, |
47 Browser* browser) | 47 Browser* browser) |
48 : LabelButton(listener, base::string16()), | 48 : LabelButton(listener, base::string16()), |
49 browser_(browser), | 49 browser_(browser), |
50 has_auth_error_(false), | 50 has_auth_error_(false), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 const int kDefaultImageTextSpacing = 5; | 203 const int kDefaultImageTextSpacing = 5; |
204 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); | 204 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); |
205 | 205 |
206 InvalidateLayout(); | 206 InvalidateLayout(); |
207 | 207 |
208 // Because the width of the button might have changed, the parent browser | 208 // Because the width of the button might have changed, the parent browser |
209 // frame needs to recalculate the button bounds and redraw it. | 209 // frame needs to recalculate the button bounds and redraw it. |
210 if (parent()) | 210 if (parent()) |
211 parent()->Layout(); | 211 parent()->Layout(); |
212 } | 212 } |
OLD | NEW |