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

Side by Side 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 thread violation 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
7
8 #include "ash/desktop_background/desktop_background_resources.h"
9 #include "chrome/browser/extensions/extension_function.h"
10 #include "net/url_request/url_fetcher_delegate.h"
11 #include "ui/gfx/image/image_skia.h"
12
13 // Wallpaper manager strings.
14 class WallpaperStringsFunction : public SyncExtensionFunction {
15 public:
16 DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.getStrings");
17
18 protected:
19 virtual ~WallpaperStringsFunction() {}
20
21 // SyncExtensionFunction overrides.
22 virtual bool RunImpl() OVERRIDE;
23 };
24
25 class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
26 public:
27 DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.setWallpaper");
28
29 protected:
30 virtual ~WallpaperSetWallpaperFunction() {}
31
32 // AsyncExtensionFunction overrides.
33 virtual bool RunImpl() OVERRIDE;
34
35 private:
36 class WallpaperDecoder;
37
38 void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper);
39 void OnFail();
40
41 // Saves the image data to a file.
42 void SaveToFile();
43
44 // Sets wallpaper to the decoded image.
45 void SetDecodedWallpaper();
46
47 // Layout of the downloaded wallpaper.
48 ash::WallpaperLayout layout_;
49
50 // The decoded wallpaper.
51 gfx::ImageSkia wallpaper_;
52
53 // Email address of logged in user.
54 std::string email_;
55
56 // File name extracts from URL.
57 std::string file_name_;
58
59 // String representation of downloaded wallpaper.
60 std::string image_data_;
61
62 // Holds an instance of WallpaperDecoder.
63 static WallpaperDecoder* wallpaper_decoder_;
64 };
65
66 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698