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

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

Issue 11348215: Make wallpaper picker manifest and thumbnails available when offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove success paramter and add a todo Created 8 years 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 4b3a0acb697f7d2d7307eb66076140b9fe6e9790..de84d40ff1d12a4bc5a00a13d0993f17dec31934 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.h
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h
@@ -138,4 +138,65 @@ class WallpaperRestoreMinimizedWindowsFunction : public AsyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
};
+class WallpaperGetThumbnailFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.getThumbnail");
+
+ WallpaperGetThumbnailFunction();
+
+ protected:
+ virtual ~WallpaperGetThumbnailFunction();
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ // Failed to get thumbnail for |file_name|.
+ void Failure(const std::string& file_name);
+
+ // Sets success field in the results to false. Called when the requested
+ // thumbnail is not found or corrupted in thumbnail directory.
+ void FileNotLoaded();
+
+ // Sets success field to true and data field to the loaded thumbnail binary
+ // data in the results. Called when requested wallpaper thumbnail loaded
+ // successfully.
+ void FileLoaded(const std::string& data);
+
+ // Gets thumbnail with |file_name| from thumbnail directory. If |file_name|
+ // does not exist, call FileNotLoaded().
+ void Get(const std::string& file_name);
+
+ // Sequence token associated with wallpaper operations. Shared with
+ // WallpaperManager.
+ base::SequencedWorkerPool::SequenceToken sequence_token_;
+};
+
+class WallpaperSaveThumbnailFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.saveThumbnail");
+
+ WallpaperSaveThumbnailFunction();
+
+ protected:
+ virtual ~WallpaperSaveThumbnailFunction();
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ // Failed to save thumbnail for |file_name|.
+ void Failure(const std::string& file_name);
+
+ // Saved thumbnail to thumbnail directory.
+ void Success();
+
+ // Saves thumbnail to thumbnail directory as |file_name|.
+ void Save(const std::string& data, const std::string& file_name);
+
+ // Sequence token associated with wallpaper operations. Shared with
+ // WallpaperManager.
+ base::SequencedWorkerPool::SequenceToken sequence_token_;
+};
+
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698