| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" | 9 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" |
| 10 #include "chrome/common/extensions/api/wallpaper_private.h" | 10 #include "chrome/common/extensions/api/wallpaper_private.h" |
| 11 #include "net/url_request/url_fetcher_delegate.h" | 11 #include "net/url_request/url_fetcher_delegate.h" |
| 12 | 12 |
| 13 namespace chromeos { | 13 namespace chromeos { |
| 14 class UserImage; | 14 class UserImage; |
| 15 } // namespace chromeos | 15 } // namespace chromeos |
| 16 | 16 |
| 17 // Wallpaper manager strings. | 17 // Wallpaper manager strings. |
| 18 class WallpaperPrivateGetStringsFunction : public SyncExtensionFunction { | 18 class WallpaperPrivateGetStringsFunction : public SyncExtensionFunction { |
| 19 public: | 19 public: |
| 20 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getStrings", | 20 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getStrings", |
| 21 WALLPAPERPRIVATE_GETSTRINGS) | 21 WALLPAPERPRIVATE_GETSTRINGS) |
| 22 | 22 |
| 23 protected: | 23 protected: |
| 24 virtual ~WallpaperPrivateGetStringsFunction() {} | 24 virtual ~WallpaperPrivateGetStringsFunction() {} |
| 25 | 25 |
| 26 // SyncExtensionFunction overrides. | 26 // SyncExtensionFunction overrides. |
| 27 virtual bool RunSync() override; | 27 virtual bool RunSync() override; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 // Check if sync themes setting is enabled. |
| 31 class WallpaperPrivateGetSyncSettingFunction : public SyncExtensionFunction { |
| 32 public: |
| 33 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getSyncSetting", |
| 34 WALLPAPERPRIVATE_GETSYNCSETTING) |
| 35 |
| 36 protected: |
| 37 virtual ~WallpaperPrivateGetSyncSettingFunction() {} |
| 38 |
| 39 // SyncExtensionFunction overrides. |
| 40 virtual bool RunSync() override; |
| 41 }; |
| 42 |
| 30 class WallpaperPrivateSetWallpaperIfExistsFunction | 43 class WallpaperPrivateSetWallpaperIfExistsFunction |
| 31 : public WallpaperFunctionBase { | 44 : public WallpaperFunctionBase { |
| 32 public: | 45 public: |
| 33 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.setWallpaperIfExists", | 46 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.setWallpaperIfExists", |
| 34 WALLPAPERPRIVATE_SETWALLPAPERIFEXISTS) | 47 WALLPAPERPRIVATE_SETWALLPAPERIFEXISTS) |
| 35 | 48 |
| 36 WallpaperPrivateSetWallpaperIfExistsFunction(); | 49 WallpaperPrivateSetWallpaperIfExistsFunction(); |
| 37 | 50 |
| 38 protected: | 51 protected: |
| 39 virtual ~WallpaperPrivateSetWallpaperIfExistsFunction(); | 52 virtual ~WallpaperPrivateSetWallpaperIfExistsFunction(); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // Sends the list of files to extension api caller. If no files or no | 292 // Sends the list of files to extension api caller. If no files or no |
| 280 // directory, sends empty list. | 293 // directory, sends empty list. |
| 281 void OnComplete(const std::vector<std::string>& file_list); | 294 void OnComplete(const std::vector<std::string>& file_list); |
| 282 | 295 |
| 283 // Sequence token associated with wallpaper operations. Shared with | 296 // Sequence token associated with wallpaper operations. Shared with |
| 284 // WallpaperManager. | 297 // WallpaperManager. |
| 285 base::SequencedWorkerPool::SequenceToken sequence_token_; | 298 base::SequencedWorkerPool::SequenceToken sequence_token_; |
| 286 }; | 299 }; |
| 287 | 300 |
| 288 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ | 301 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ |
| OLD | NEW |