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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 9580023: Enable user change background image in settings page in Aura build. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Save user choosed index to local state Created 8 years, 9 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
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..121edb6fdb883616bc61b5215ef1a6e9137a8844 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -29,14 +29,17 @@ static int RoundPositive(double x) {
// DesktopBackgroundView, public:
DesktopBackgroundView::DesktopBackgroundView() {
- wallpaper_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_AURA_WALLPAPER_1).ToSkBitmap();
- wallpaper_.buildMipMap(false);
}
DesktopBackgroundView::~DesktopBackgroundView() {
}
+void DesktopBackgroundView::SetWallpaper(const SkBitmap& wallpaper) {
+ wallpaper_ = wallpaper;
+ wallpaper_.buildMipMap(false);
+ SchedulePaint();
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopBackgroundView, views::View overrides:
@@ -92,7 +95,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 = new DesktopBackgroundView();
params.delegate = view;
params.parent =
Shell::GetInstance()->GetContainer(

Powered by Google App Engine
This is Rietveld 408576698