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 |