| 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 "ash/launcher/launcher_button.h" | 5 #include "ash/launcher/launcher_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/launcher/launcher_button_host.h" | 10 #include "ash/launcher/launcher_button_host.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 LauncherButton::~LauncherButton() { | 241 LauncherButton::~LauncherButton() { |
| 242 } | 242 } |
| 243 | 243 |
| 244 void LauncherButton::SetShadowedImage(const gfx::ImageSkia& image) { | 244 void LauncherButton::SetShadowedImage(const gfx::ImageSkia& image) { |
| 245 icon_view_->SetImage(gfx::ImageSkiaOperations::CreateImageWithDropShadow( | 245 icon_view_->SetImage(gfx::ImageSkiaOperations::CreateImageWithDropShadow( |
| 246 image, icon_shadows_)); | 246 image, icon_shadows_)); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void LauncherButton::SetImage(const gfx::ImageSkia& image) { | 249 void LauncherButton::SetImage(const gfx::ImageSkia& image) { |
| 250 if (image.empty()) { | 250 if (image.isNull()) { |
| 251 // TODO: need an empty image. | 251 // TODO: need an empty image. |
| 252 icon_view_->SetImage(image); | 252 icon_view_->SetImage(image); |
| 253 return; | 253 return; |
| 254 } | 254 } |
| 255 | 255 |
| 256 if (icon_view_->icon_size() == 0) { | 256 if (icon_view_->icon_size() == 0) { |
| 257 SetShadowedImage(image); | 257 SetShadowedImage(image); |
| 258 return; | 258 return; |
| 259 } | 259 } |
| 260 | 260 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 504 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
| 505 break; | 505 break; |
| 506 } | 506 } |
| 507 | 507 |
| 508 Layout(); | 508 Layout(); |
| 509 SchedulePaint(); | 509 SchedulePaint(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace internal | 512 } // namespace internal |
| 513 } // namespace ash | 513 } // namespace ash |
| OLD | NEW |