OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_API_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_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.h" | 10 #include "chrome/common/extensions/api/wallpaper.h" |
| 11 #include "components/signin/core/account_id/account_id.h" |
11 #include "net/url_request/url_request_status.h" | 12 #include "net/url_request/url_request_status.h" |
12 | 13 |
13 // Implementation of chrome.wallpaper.setWallpaper API. | 14 // Implementation of chrome.wallpaper.setWallpaper API. |
14 // After this API being called, a jpeg encoded wallpaper will be saved to | 15 // After this API being called, a jpeg encoded wallpaper will be saved to |
15 // /home/chronos/custom_wallpaper/{resolution}/{user_id_hash}/file_name. The | 16 // /home/chronos/custom_wallpaper/{resolution}/{user_id_hash}/file_name. The |
16 // wallpaper can then persistent after Chrome restart. New call to this API | 17 // wallpaper can then persistent after Chrome restart. New call to this API |
17 // will replace the previous saved wallpaper with new one. | 18 // will replace the previous saved wallpaper with new one. |
18 // Note: For security reason, the original encoded wallpaper image is not saved | 19 // Note: For security reason, the original encoded wallpaper image is not saved |
19 // directly. It is decoded and re-encoded to jpeg format before saved to file | 20 // directly. It is decoded and re-encoded to jpeg format before saved to file |
20 // system. | 21 // system. |
(...skipping 23 matching lines...) Expand all Loading... |
44 | 45 |
45 // Called by OnURLFetchComplete(). | 46 // Called by OnURLFetchComplete(). |
46 void OnWallpaperFetched(bool success, const std::string& response); | 47 void OnWallpaperFetched(bool success, const std::string& response); |
47 | 48 |
48 scoped_ptr<extensions::api::wallpaper::SetWallpaper::Params> params_; | 49 scoped_ptr<extensions::api::wallpaper::SetWallpaper::Params> params_; |
49 | 50 |
50 // Unique file name of the custom wallpaper. | 51 // Unique file name of the custom wallpaper. |
51 std::string file_name_; | 52 std::string file_name_; |
52 | 53 |
53 // User id of the user who initiate this API call. | 54 // User id of the user who initiate this API call. |
54 std::string user_id_; | 55 AccountId account_id_ = EmptyAccountId(); |
55 | 56 |
56 // User id hash of the logged in user. | 57 // User id hash of the logged in user. |
57 std::string user_id_hash_; | 58 std::string user_id_hash_; |
58 | 59 |
59 // Sequence token associated with wallpaper operations. Shared with | 60 // Sequence token associated with wallpaper operations. Shared with |
60 // WallpaperManager. | 61 // WallpaperManager. |
61 base::SequencedWorkerPool::SequenceToken sequence_token_; | 62 base::SequencedWorkerPool::SequenceToken sequence_token_; |
62 }; | 63 }; |
63 | 64 |
64 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_API_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_WALLPAPER_API_H_ |
65 | 66 |
OLD | NEW |