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

Unified Diff: ash/desktop_background/desktop_background_controller.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: Fix a debug build error associated with color mode switch 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_controller.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..929549844646c086fa5b9be3e41d47023f7f14c7
--- /dev/null
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/desktop_background/desktop_background_controller.h"
+
+#include "ash/desktop_background/desktop_background_resources.h"
+#include "ash/shell.h"
+#include "base/logging.h"
+#include "grit/ui_resources.h"
+#include "ui/gfx/image/image.h"
+#include "ui/base/resource/resource_bundle.h"
+
+namespace ash {
+
+DesktopBackgroundController::DesktopBackgroundController() :
+ previous_wallpaper_index_(GetPresetWallpaperIndex()) {
+}
+
+DesktopBackgroundController::~DesktopBackgroundController() {
+}
+
+void DesktopBackgroundController::OnDesktopBackgroundChange(int index) {
+ Shell::GetInstance()->SetDesktopBackgroundWallpaper(
+ GetDefaultWallpaper(index));
+ previous_wallpaper_index_ = index;
+}
+
+const SkBitmap& DesktopBackgroundController::GetPreviouseWallpaper() {
+ return GetDefaultWallpaper(previous_wallpaper_index_);
+}
+
Ben Goodger (Google) 2012/03/09 23:20:17 function order in .cc should match .h
bshe 2012/03/12 00:14:25 Done.
+const SkBitmap& DesktopBackgroundController::GetPresetWallpaper() {
+ return GetDefaultWallpaper(GetPresetWallpaperIndex());
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698