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

Unified Diff: ash/desktop_background/desktop_background_controller.h

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: 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.h
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..99607b673eca1e738b48a96581468f1ea0c2e324
--- /dev/null
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -0,0 +1,65 @@
+// 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.
+
+#ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_
+#define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "third_party/skia/include/core/SkBitmap.h"
tfarina 2012/03/12 17:07:28 nit: you can forward declare this.
bshe 2012/03/12 17:27:31 Done.
+
+namespace ash {
+
+// A class to listen for login and desktop background change events and set the
+// corresponding default wallpaper in Aura shell.
+class ASH_EXPORT DesktopBackgroundController {
+ public:
+ enum BackgroundMode {
+ BACKGROUND_IMAGE,
+ BACKGROUND_SOLID_COLOR
+ };
+
+ DesktopBackgroundController();
+ virtual ~DesktopBackgroundController();
+
+ // Get the desktop background mode.
+ BackgroundMode desktop_background_mode() const {
+ return desktop_background_mode_;
+ }
+
+ // Change the desktop background image to wallpaper with |index|.
+ void OnDesktopBackgroundChange(int index);
Ben Goodger (Google) 2012/03/12 16:34:30 Changed
bshe 2012/03/12 17:02:41 Done.
+
+ // Sets the desktop background to image mode and create a new background
+ // widget with |wallpaper|.
+ void SetDesktopBackgroundImageMode(const SkBitmap& wallpaper);
+
+ // Sets the desktop background to image mode and create a new background
+ // widget with default wallpaper.
+ void SetDefaultDesktopBackgroundImage();
+
+ // Sets the desktop background to image mode and create a new background
+ // widget with previous selected wallpaper at run time.
+ void SetPreviousDesktopBackgroundImage();
+
+ // Sets the desktop background to solid color mode and create a solid color
+ // layout.
+ void SetDesktopBackgroundSolidColorMode();
+
+ private:
+ // We need to cache the previously used wallpaper index. So when users switch
+ // desktop background color mode at run time, we can directly switch back to
+ // the user selected wallpaper in image mode.
+ int previous_wallpaper_index_;
+
+ // Can change at runtime.
+ BackgroundMode desktop_background_mode_;
+
+ DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
+};
+
+} // namespace ash
+
+#endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698