| 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> |
| 8 |
| 7 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/gfx/animation/throb_animation.h" | 11 #include "ui/gfx/animation/throb_animation.h" |
| 10 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/image/image_skia_operations.h" | 13 #include "ui/gfx/image/image_skia_operations.h" |
| 12 #include "ui/gfx/scoped_canvas.h" | 14 #include "ui/gfx/scoped_canvas.h" |
| 13 #include "ui/views/painter.h" | 15 #include "ui/views/painter.h" |
| 14 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 15 | 17 |
| 16 namespace views { | 18 namespace views { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 65 } |
| 64 | 66 |
| 65 void ImageButton::SetImageAlignment(HorizontalAlignment h_align, | 67 void ImageButton::SetImageAlignment(HorizontalAlignment h_align, |
| 66 VerticalAlignment v_align) { | 68 VerticalAlignment v_align) { |
| 67 h_alignment_ = h_align; | 69 h_alignment_ = h_align; |
| 68 v_alignment_ = v_align; | 70 v_alignment_ = v_align; |
| 69 SchedulePaint(); | 71 SchedulePaint(); |
| 70 } | 72 } |
| 71 | 73 |
| 72 void ImageButton::SetFocusPainter(scoped_ptr<Painter> focus_painter) { | 74 void ImageButton::SetFocusPainter(scoped_ptr<Painter> focus_painter) { |
| 73 focus_painter_ = focus_painter.Pass(); | 75 focus_painter_ = std::move(focus_painter); |
| 74 } | 76 } |
| 75 | 77 |
| 76 void ImageButton::SetMinimumImageSize(const gfx::Size& size) { | 78 void ImageButton::SetMinimumImageSize(const gfx::Size& size) { |
| 77 if (minimum_image_size_ == size) | 79 if (minimum_image_size_ == size) |
| 78 return; | 80 return; |
| 79 | 81 |
| 80 minimum_image_size_ = size; | 82 minimum_image_size_ = size; |
| 81 PreferredSizeChanged(); | 83 PreferredSizeChanged(); |
| 82 } | 84 } |
| 83 | 85 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 *tooltip = toggled_tooltip_text_; | 259 *tooltip = toggled_tooltip_text_; |
| 258 return true; | 260 return true; |
| 259 } | 261 } |
| 260 | 262 |
| 261 void ToggleImageButton::GetAccessibleState(ui::AXViewState* state) { | 263 void ToggleImageButton::GetAccessibleState(ui::AXViewState* state) { |
| 262 ImageButton::GetAccessibleState(state); | 264 ImageButton::GetAccessibleState(state); |
| 263 GetTooltipText(gfx::Point(), &state->name); | 265 GetTooltipText(gfx::Point(), &state->name); |
| 264 } | 266 } |
| 265 | 267 |
| 266 } // namespace views | 268 } // namespace views |
| OLD | NEW |