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

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: Add function "SaveToFile" 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 "base/file_path.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/observer_list.h"
12 #include "base/time.h"
13 #include "chrome/browser/extensions/extension_function.h"
14 #include "googleurl/src/gurl.h"
15 #include "net/url_request/url_fetcher_delegate.h"
16 #include "ui/gfx/image/image_skia.h"
17
18 extern const char kWallpaperManagerDomain[];
19
20 namespace wallpaper_manager_util {
Mihai Parparita -not on Chrome 2012/07/20 00:17:05 You may want to have this in a separate file, it d
bshe 2012/07/22 23:59:42 Done.
21
22 // Opens wallpaper manager application.
23 void OpenWallpaperManager();
24
25 } // namespace wallpaper_manager_util
26
27 // Wallpaper manager strings.
28 class WallpaperStringsFunction : public SyncExtensionFunction {
29 public:
30 DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.getStrings");
31
32 protected:
33 virtual ~WallpaperStringsFunction() {}
34
35 // SyncExtensionFunction overrides.
36 virtual bool RunImpl() OVERRIDE;
37 };
38
39 class WallpaperSetWallpaperFunction : public AsyncExtensionFunction {
40 public:
41 DECLARE_EXTENSION_FUNCTION_NAME("wallpaperPrivate.setWallpaper");
42
43 void SetWallpaper(const gfx::ImageSkia& wallpaper);
44
45 protected:
46 virtual ~WallpaperSetWallpaperFunction() {}
47
48 // AsyncExtensionFunction overrides.
49 virtual bool RunImpl() OVERRIDE;
50
51 private:
52 class WallpaperDecoder;
53
54 // Saves the image data to a file.
55 bool SaveToFile();
56
57 // Layout of the downloaded wallpaper.
58 ash::WallpaperLayout layout_;
59
60 // Email address of logged in user.
61 std::string email_;
62
63 // File name extracts from URL.
64 std::string file_name_;
65
66 // String representation of downloaded wallpaper.
67 std::string image_data_;
68
69 // Holds an instance of WallpaperDecoder.
70 static WallpaperDecoder* wallpaper_decoder_;
71 };
72
73 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698