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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.h

Issue 10890038: Hook up custom wallpaper code path to new wallpaper picker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: chrome/browser/chromeos/extensions/wallpaper_private_api.h
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.h b/chrome/browser/chromeos/extensions/wallpaper_private_api.h
index 247bd11ad0086361584b27a88a9ce0197d773f72..00ed386dd2967431b128df213933ac24283dc651 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.h
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h
@@ -22,7 +22,27 @@ class WallpaperStringsFunction : public SyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
};
-class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
+class WallpaperFunctionBase : public AsyncExtensionFunction {
+ public:
+ WallpaperFunctionBase();
+
+ protected:
+ virtual ~WallpaperFunctionBase();
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+
+ class WallpaperDecoder;
Ivan Korotkov 2012/08/30 14:07:36 Forward declarations go after includes.
bshe 2012/08/30 19:22:40 Looks like this is a nested class. Not sure if I s
+
+ // Holds an instance of WallpaperDecoder.
+ static WallpaperDecoder* wallpaper_decoder_;
+
+ private:
+ virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) = 0;
+ virtual void OnFail() = 0;
Ivan Korotkov 2012/08/30 14:07:36 OnFailure?
bshe 2012/08/30 19:22:40 Done.
+};
+
+class WallpaperSetWallpaperFunction : public WallpaperFunctionBase {
public:
DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.setWallpaper");
@@ -35,10 +55,8 @@ class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
private:
- class WallpaperDecoder;
-
- void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper);
- void OnFail();
+ virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) OVERRIDE;
+ virtual void OnFail() OVERRIDE;
// Saves the image data to a file.
void SaveToFile();
@@ -60,9 +78,32 @@ class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
// String representation of downloaded wallpaper.
std::string image_data_;
+};
- // Holds an instance of WallpaperDecoder.
- static WallpaperDecoder* wallpaper_decoder_;
+class WallpaperSetCustomWallpaperFunction : public WallpaperFunctionBase {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.setCustomWallpaper");
+
+ WallpaperSetCustomWallpaperFunction();
+
+ protected:
+ virtual ~WallpaperSetCustomWallpaperFunction();
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) OVERRIDE;
+ virtual void OnFail() OVERRIDE;
+
+ // Layout of the downloaded wallpaper.
+ ash::WallpaperLayout layout_;
+
+ // Email address of logged in user.
+ std::string email_;
+
+ // String representation of downloaded wallpaper.
+ std::string image_data_;
};
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698