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

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: Merge to trunk Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..efbbac5961634dacbecd3df49c3cd7959ba3bd8e 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 {
+// Wallpaper manager function base. It contains a JPEG decoder to decode
+// wallpaper data.
+class WallpaperFunctionBase : public AsyncExtensionFunction {
+ public:
+ WallpaperFunctionBase();
+
+ protected:
+ virtual ~WallpaperFunctionBase();
+
+ // A class to decode JPEG file.
+ class WallpaperDecoder;
+
+ // Holds an instance of WallpaperDecoder.
+ static WallpaperDecoder* wallpaper_decoder_;
+
+ private:
+ virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) = 0;
+ virtual void OnFailure() = 0;
+};
+
+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 OnFailure() 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 OnFailure() 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_
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698