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> |
| 9 #include <vector> |
| 10 |
8 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
9 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" | 12 #include "chrome/browser/chromeos/extensions/wallpaper_function_base.h" |
10 #include "chrome/common/extensions/api/wallpaper_private.h" | 13 #include "chrome/common/extensions/api/wallpaper_private.h" |
11 #include "net/url_request/url_fetcher_delegate.h" | 14 #include "net/url_request/url_fetcher_delegate.h" |
12 | 15 |
13 namespace chromeos { | 16 namespace chromeos { |
14 class UserImage; | 17 class UserImage; |
15 } // namespace chromeos | 18 } // namespace chromeos |
16 | 19 |
17 // Wallpaper manager strings. | 20 // Wallpaper manager strings. |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 bool RunAsync() override; | 261 bool RunAsync() override; |
259 | 262 |
260 private: | 263 private: |
261 // Failed to save thumbnail for |file_name|. | 264 // Failed to save thumbnail for |file_name|. |
262 void Failure(const std::string& file_name); | 265 void Failure(const std::string& file_name); |
263 | 266 |
264 // Saved thumbnail to thumbnail directory. | 267 // Saved thumbnail to thumbnail directory. |
265 void Success(); | 268 void Success(); |
266 | 269 |
267 // Saves thumbnail to thumbnail directory as |file_name|. | 270 // Saves thumbnail to thumbnail directory as |file_name|. |
268 void Save(const std::string& data, const std::string& file_name); | 271 void Save(const std::vector<char>& data, const std::string& file_name); |
269 | 272 |
270 // Sequence token associated with wallpaper operations. Shared with | 273 // Sequence token associated with wallpaper operations. Shared with |
271 // WallpaperManager. | 274 // WallpaperManager. |
272 base::SequencedWorkerPool::SequenceToken sequence_token_; | 275 base::SequencedWorkerPool::SequenceToken sequence_token_; |
273 }; | 276 }; |
274 | 277 |
275 class WallpaperPrivateGetOfflineWallpaperListFunction | 278 class WallpaperPrivateGetOfflineWallpaperListFunction |
276 : public AsyncExtensionFunction { | 279 : public AsyncExtensionFunction { |
277 public: | 280 public: |
278 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getOfflineWallpaperList", | 281 DECLARE_EXTENSION_FUNCTION("wallpaperPrivate.getOfflineWallpaperList", |
(...skipping 13 matching lines...) Expand all Loading... |
292 // Sends the list of files to extension api caller. If no files or no | 295 // Sends the list of files to extension api caller. If no files or no |
293 // directory, sends empty list. | 296 // directory, sends empty list. |
294 void OnComplete(const std::vector<std::string>& file_list); | 297 void OnComplete(const std::vector<std::string>& file_list); |
295 | 298 |
296 // Sequence token associated with wallpaper operations. Shared with | 299 // Sequence token associated with wallpaper operations. Shared with |
297 // WallpaperManager. | 300 // WallpaperManager. |
298 base::SequencedWorkerPool::SequenceToken sequence_token_; | 301 base::SequencedWorkerPool::SequenceToken sequence_token_; |
299 }; | 302 }; |
300 | 303 |
301 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ | 304 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_PRIVATE_API_H_ |
OLD | NEW |