| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
| 12 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" | 12 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" |
| 13 #include "chrome/common/extensions/api/wallpaper_private.h" | 13 #include "chrome/common/extensions/api/wallpaper_private.h" |
| 14 #include "components/signin/core/account_id/account_id.h" | 14 #include "components/signin/core/account_id/account_id.h" |
| 15 #include "components/wallpaper/wallpaper_files_id.h" | 15 #include "components/wallpaper/wallpaper_files_id.h" |
| 16 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class RefCountedBytes; | 19 class RefCountedBytes; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace chromeos { | 22 namespace chromeos { |
| 23 class UserImage; | 23 class UserImage; |
| 24 } // namespace chromeos | 24 } // namespace chromeos |
| 25 | 25 |
| 26 // Wallpaper manager strings. | 26 // Wallpaper manager strings. |
| 27 class WallpaperPrivateGetStringsFunction : public SyncExtensionFunction { | 27 class WallpaperPrivateGetStringsFunction : public UIThreadExtensionFunction { |
| 28 public: | 28 public: |
| 29 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getStrings", | 29 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getStrings", |
| 30 WALLPAPERPRIVATE_GETSTRINGS) | 30 WALLPAPERPRIVATE_GETSTRINGS) |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 ~WallpaperPrivateGetStringsFunction() override {} | 33 ~WallpaperPrivateGetStringsFunction() override {} |
| 34 | 34 |
| 35 // SyncExtensionFunction overrides. | 35 // ExtensionFunction: |
| 36 bool RunSync() override; | 36 ResponseAction Run() override; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Check if sync themes setting is enabled. | 39 // Check if sync themes setting is enabled. |
| 40 class WallpaperPrivateGetSyncSettingFunction : public SyncExtensionFunction { | 40 class WallpaperPrivateGetSyncSettingFunction |
| 41 : public UIThreadExtensionFunction { |
| 41 public: | 42 public: |
| 42 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getSyncSetting", | 43 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getSyncSetting", |
| 43 WALLPAPERPRIVATE_GETSYNCSETTING) | 44 WALLPAPERPRIVATE_GETSYNCSETTING) |
| 44 | 45 |
| 45 protected: | 46 protected: |
| 46 ~WallpaperPrivateGetSyncSettingFunction() override {} | 47 ~WallpaperPrivateGetSyncSettingFunction() override {} |
| 47 | 48 |
| 48 // SyncExtensionFunction overrides. | 49 // ExtensionFunction: |
| 49 bool RunSync() override; | 50 ResponseAction Run() override; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 class WallpaperPrivateSetWallpaperIfExistsFunction | 53 class WallpaperPrivateSetWallpaperIfExistsFunction |
| 53 : public WallpaperFunctionBase { | 54 : public WallpaperFunctionBase { |
| 54 public: | 55 public: |
| 55 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.setWallpaperIfExists", | 56 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.setWallpaperIfExists", |
| 56 WALLPAPERPRIVATE_SETWALLPAPERIFEXISTS) | 57 WALLPAPERPRIVATE_SETWALLPAPERIFEXISTS) |
| 57 | 58 |
| 58 WallpaperPrivateSetWallpaperIfExistsFunction(); | 59 WallpaperPrivateSetWallpaperIfExistsFunction(); |
| 59 | 60 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void OnComplete(const std::vector<std::string>& file_list); | 303 void OnComplete(const std::vector<std::string>& file_list); |
| 303 | 304 |
| 304 // Sequence token associated with wallpaper operations. Shared with | 305 // Sequence token associated with wallpaper operations. Shared with |
| 305 // WallpaperManager. | 306 // WallpaperManager. |
| 306 base::SequencedWorkerPool::SequenceToken sequence_token_; | 307 base::SequencedWorkerPool::SequenceToken sequence_token_; |
| 307 }; | 308 }; |
| 308 | 309 |
| 309 // The wallpaper UMA is recorded when a new wallpaper is set, either by the | 310 // The wallpaper UMA is recorded when a new wallpaper is set, either by the |
| 310 // built-in Wallpaper Picker App, or by a third party App. | 311 // built-in Wallpaper Picker App, or by a third party App. |
| 311 class WallpaperPrivateRecordWallpaperUMAFunction | 312 class WallpaperPrivateRecordWallpaperUMAFunction |
| 312 : public SyncExtensionFunction { | 313 : public UIThreadExtensionFunction { |
| 313 public: | 314 public: |
| 314 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.recordWallpaperUMA", | 315 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.recordWallpaperUMA", |
| 315 WALLPAPERPRIVATE_RECORDWALLPAPERUMA) | 316 WALLPAPERPRIVATE_RECORDWALLPAPERUMA) |
| 316 | 317 |
| 317 protected: | 318 protected: |
| 318 ~WallpaperPrivateRecordWallpaperUMAFunction() override {} | 319 ~WallpaperPrivateRecordWallpaperUMAFunction() override {} |
| 319 | 320 |
| 320 // SyncExtensionFunction overrides. | 321 // ExtensionFunction: |
| 321 bool RunSync() override; | 322 ResponseAction Run() override; |
| 322 }; | 323 }; |
| 323 | 324 |
| 324 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ | 325 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ |
| OLD | NEW |