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

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

Issue 10754014: Wallpaper manager backend APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error on linux_chromeos_clang and format nits Created 8 years, 5 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
new file mode 100644
index 0000000000000000000000000000000000000000..247bd11ad0086361584b27a88a9ce0197d773f72
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h
@@ -0,0 +1,68 @@
+// 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 CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
+
+#include "ash/desktop_background/desktop_background_resources.h"
+#include "chrome/browser/extensions/extension_function.h"
+#include "net/url_request/url_fetcher_delegate.h"
+#include "ui/gfx/image/image_skia.h"
+
+// Wallpaper manager strings.
+class WallpaperStringsFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.getStrings");
+
+ protected:
+ virtual ~WallpaperStringsFunction() {}
+
+ // SyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+};
+
+class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.setWallpaper");
+
+ WallpaperSetWallpaperFunction();
+
+ protected:
+ virtual ~WallpaperSetWallpaperFunction();
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ class WallpaperDecoder;
+
+ void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper);
+ void OnFail();
+
+ // Saves the image data to a file.
+ void SaveToFile();
+
+ // Sets wallpaper to the decoded image.
+ void SetDecodedWallpaper();
+
+ // Layout of the downloaded wallpaper.
+ ash::WallpaperLayout layout_;
+
+ // The decoded wallpaper.
+ gfx::ImageSkia wallpaper_;
+
+ // Email address of logged in user.
+ std::string email_;
+
+ // File name extracts from URL.
+ std::string file_name_;
+
+ // String representation of downloaded wallpaper.
+ std::string image_data_;
+
+ // Holds an instance of WallpaperDecoder.
+ static WallpaperDecoder* wallpaper_decoder_;
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698