Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: ui/views/controls/button/image_button.cc

Issue 2618383004: Revert of Move more vector icons to respective directories and update code to (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button.cc
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
index fd2151e2a1aab73c6ad529ec5a909ffd9ea309ab..e875612c10ea5dbceaac42ce1796fb633983b731 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -48,14 +48,10 @@
}
void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia* image) {
- SetImage(for_state, image ? *image : gfx::ImageSkia());
-}
-
-void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia& image) {
if (for_state == STATE_HOVERED)
- set_animate_on_state_change(!image.isNull());
+ set_animate_on_state_change(image != nullptr);
const gfx::Size old_preferred_size = GetPreferredSize();
- images_[for_state] = image;
+ images_[for_state] = image ? *image : gfx::ImageSkia();
if (old_preferred_size != GetPreferredSize())
PreferredSizeChanged();
@@ -254,11 +250,11 @@
}
void ToggleImageButton::SetImage(ButtonState image_state,
- const gfx::ImageSkia& image) {
+ const gfx::ImageSkia* image) {
if (toggled_) {
- alternate_images_[image_state] = image;
+ alternate_images_[image_state] = image ? *image : gfx::ImageSkia();
} else {
- images_[image_state] = image;
+ images_[image_state] = image ? *image : gfx::ImageSkia();
if (state() == image_state)
SchedulePaint();
}
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698