Chromium Code Reviews| 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..5a45831d135d4b026754f87e447812d84522382e |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h |
| @@ -0,0 +1,73 @@ |
| +// 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 "base/file_path.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/observer_list.h" |
| +#include "base/time.h" |
| +#include "chrome/browser/extensions/extension_function.h" |
| +#include "googleurl/src/gurl.h" |
| +#include "net/url_request/url_fetcher_delegate.h" |
| +#include "ui/gfx/image/image_skia.h" |
| + |
| +extern const char kWallpaperManagerDomain[]; |
| + |
| +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.
|
| + |
| +// Opens wallpaper manager application. |
| +void OpenWallpaperManager(); |
| + |
| +} // namespace wallpaper_manager_util |
| + |
| +// 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"); |
| + |
| + void SetWallpaper(const gfx::ImageSkia& wallpaper); |
| + |
| + protected: |
| + virtual ~WallpaperSetWallpaperFunction() {} |
| + |
| + // AsyncExtensionFunction overrides. |
| + virtual bool RunImpl() OVERRIDE; |
| + |
| + private: |
| + class WallpaperDecoder; |
| + |
| + // Saves the image data to a file. |
| + bool SaveToFile(); |
| + |
| + // Layout of the downloaded wallpaper. |
| + ash::WallpaperLayout layout_; |
| + |
| + // 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_ |