OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/button/image_button.h" | 5 #include "ui/views/controls/button/image_button.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 *image, *mask); | 66 *image, *mask); |
67 } | 67 } |
68 | 68 |
69 void ImageButton::SetImageAlignment(HorizontalAlignment h_align, | 69 void ImageButton::SetImageAlignment(HorizontalAlignment h_align, |
70 VerticalAlignment v_align) { | 70 VerticalAlignment v_align) { |
71 h_alignment_ = h_align; | 71 h_alignment_ = h_align; |
72 v_alignment_ = v_align; | 72 v_alignment_ = v_align; |
73 SchedulePaint(); | 73 SchedulePaint(); |
74 } | 74 } |
75 | 75 |
76 void ImageButton::SetFocusPainter(scoped_ptr<Painter> focus_painter) { | 76 void ImageButton::SetFocusPainter(std::unique_ptr<Painter> focus_painter) { |
77 focus_painter_ = std::move(focus_painter); | 77 focus_painter_ = std::move(focus_painter); |
78 } | 78 } |
79 | 79 |
80 void ImageButton::SetMinimumImageSize(const gfx::Size& size) { | 80 void ImageButton::SetMinimumImageSize(const gfx::Size& size) { |
81 if (minimum_image_size_ == size) | 81 if (minimum_image_size_ == size) |
82 return; | 82 return; |
83 | 83 |
84 minimum_image_size_ = size; | 84 minimum_image_size_ = size; |
85 PreferredSizeChanged(); | 85 PreferredSizeChanged(); |
86 } | 86 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 *tooltip = toggled_tooltip_text_; | 266 *tooltip = toggled_tooltip_text_; |
267 return true; | 267 return true; |
268 } | 268 } |
269 | 269 |
270 void ToggleImageButton::GetAccessibleState(ui::AXViewState* state) { | 270 void ToggleImageButton::GetAccessibleState(ui::AXViewState* state) { |
271 ImageButton::GetAccessibleState(state); | 271 ImageButton::GetAccessibleState(state); |
272 GetTooltipText(gfx::Point(), &state->name); | 272 GetTooltipText(gfx::Point(), &state->name); |
273 } | 273 } |
274 | 274 |
275 } // namespace views | 275 } // namespace views |
OLD | NEW |