Chromium Code Reviews| Index: ash/desktop_background/desktop_background_view.cc |
| diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc |
| index dbf256f0499df461eccbaff9cee46a3b78ca9305..241800560eeb697dee9233a16086307713b054c1 100644 |
| --- a/ash/desktop_background/desktop_background_view.cc |
| +++ b/ash/desktop_background/desktop_background_view.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "ash/desktop_background/desktop_background_view.h" |
| +#include "ash/desktop_background/desktop_background_controller.h" |
|
flackr
2012/03/05 16:16:03
This include goes below with the others. desktop_b
bshe
2012/03/06 01:33:27
Done.
|
| #include <limits> |
| @@ -18,8 +19,8 @@ |
| #include "ui/views/widget/widget.h" |
| namespace ash { |
| -namespace internal { |
|
flackr
2012/03/05 16:16:03
nit: no newline here.
bshe
2012/03/06 01:33:27
Done.
|
| +namespace internal { |
| // For our scaling ratios we need to round positive numbers. |
| static int RoundPositive(double x) { |
| return static_cast<int>(floor(x + 0.5)); |
| @@ -37,6 +38,17 @@ DesktopBackgroundView::DesktopBackgroundView() { |
| DesktopBackgroundView::~DesktopBackgroundView() { |
| } |
| +void DesktopBackgroundView::SetWallpaper(const SkBitmap& wallpaper) { |
| + wallpaper_ = wallpaper; |
| + wallpaper_.buildMipMap(false); |
| + SchedulePaint(); |
| +} |
| + |
| +//static |
| +DesktopBackgroundView* DesktopBackgroundView::GetInstance() { |
| + return Singleton<DesktopBackgroundView>::get(); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // DesktopBackgroundView, views::View overrides: |
| @@ -92,7 +104,7 @@ views::Widget* CreateDesktopBackground() { |
| views::Widget* desktop_widget = new views::Widget; |
| views::Widget::InitParams params( |
| views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| - DesktopBackgroundView* view = new DesktopBackgroundView; |
| + DesktopBackgroundView* view = DesktopBackgroundView::GetInstance(); |
| params.delegate = view; |
| params.parent = |
| Shell::GetInstance()->GetContainer( |